[ic] perl to strip hyphens etc?

Daniel Davenport ddavenport at newagedigital.com
Tue Jun 22 11:40:33 EDT 2004

> From: interchange-users-bounces at icdevgroup.org
> Sent: Tuesday, June 22, 2004 10:43 AM
> To: interchange-users at icdevgroup.org
> Subject: [ic] perl to strip hyphens etc?
> > 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?

could be because you're writing $array->{phone_day} when $phone_day is what
you modified.  You're still writing the original to the file.

btw, there's a 'digits' filter....[filter digits]804-555-1212[/filter] will
return 8045551212.
in perl, {return $Tag->filter('digits', '804-555-1212'); } accomplishes the
same result.

More information about the interchange-users mailing list