[ic] perl to strip hyphens etc?

Mark Weaver mark at americanmicroinc.com
Tue Jun 22 10:57:44 EDT 2004


DB wrote:

>> I think IC has some (perl?) magic to strip hyphens and spaces from
>> credit card numbers. I want to do the same with phone numbers. Can
>> anyone tell me where that is, or better yet post the magic perl snippet?
>>
>> DB
> 
> 
> Ok I tried  the following but it seems to have no effect. I'm trying to
> remove hyphens from a phone number before I write it to a file.
> 
> #clean up phone numbers
> $phone_day=$array->{phone_day};
> $phone_day=~ s/[\-]+/ /g;
> print OUTFILE "$array->{phone_day}|";
> 
> Why does this not work? Any ideas?
> 
> DB

off the top of my head, if the code you've posted above is exactly what
you're using, I'd say its because you've got a pipe "|" symbol at the
end of the last line:

	print OUTFILE "$array->{phone_day}|";

try it this way:

	print OUTFILE "$array->{phone_day}";

That should work better.

-- 
Mark Weaver
American Micro - Webmaster
1-800-558-2058




More information about the interchange-users mailing list