in reply to Getting numeric value of an alphabetic string
See chr and ord. You can also use unpack to retrieve the character codes for a string in one go:
$ perl -le 'print for unpack("C*","foo")' 102 111 111
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting numeric value of a alphabetic string
by chakkaln (Sexton) on Aug 05, 2005 at 07:11 UTC |