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.
In reply to Re: Getting numeric value of a alphabetic string
by xdg
in thread Getting numeric value of an alphabetic string
by chakkaln
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |