in reply to formatted phone number from variable
Rather than updating the phone number with REs, why not:
printf(), sprintf() and unpack() functions are generally considered efficient.my $phone = '1234567890'; printf("(%s)%s-%s\n", unpack "A3 A3 A*", $phone);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: formatted phone number from variable
by apsyrtes (Beadle) on May 22, 2003 at 18:11 UTC |