toonski has asked for the wisdom of the Perl Monks concerning the following question:
while ($x =~ /(\.)/) { $temp = ord($1); $x =~ s/\./$temp/; }
but then it would do around 64k regexes on a single string, which wouldnt be cool. Is there a way to get around this using a single regex or without resorting to pack() or am I better off just running through each character in a for loop with substr and converting it that way?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Converting ascii to numbers (unpack)
by tye (Sage) on Feb 15, 2004 at 05:42 UTC | |
by davido (Cardinal) on Feb 15, 2004 at 06:12 UTC | |
by Anonymous Monk on Feb 15, 2004 at 08:23 UTC | |
by ysth (Canon) on Feb 16, 2004 at 04:08 UTC | |
|
Re: Converting ascii to numbers
by blokhead (Monsignor) on Feb 15, 2004 at 05:21 UTC | |
|
Re: Converting ascii to numbers
by diotalevi (Canon) on Feb 15, 2004 at 05:19 UTC | |
|
Re: Converting ascii to numbers
by Skeeve (Parson) on Feb 15, 2004 at 11:46 UTC | |
|
Re: Converting ascii to numbers
by Abigail-II (Bishop) on Feb 15, 2004 at 16:42 UTC |