[ic] perl to strip hyphens etc?

Jon Jensen jon at endpoint.com
Tue Jun 22 11:15:04 EDT 2004


On Tue, 22 Jun 2004, DB wrote:

> 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?

What about it doesn't work? Where is this code? Normally in Interchange 
you wouldn't be printing the output, but maybe in usertag.

In any case, your regex needs only be:

$phone_day =~ s/-+/ /g;

Jon


More information about the interchange-users mailing list