in reply to How to extract the first elemnet from an integer type value ???

People are giving you lots of little recipes, without explaining how they work. The basic idea is this:
In Perl, you can just use a number in a scalar as a string.
Perl will convert it for you, from number to string, if necessary. So, all you have to do is extract the first character from the number treated as a string. That's what substr, unpack, the regex /^(.)/ all do.
  • Comment on Re: How to extract the first elemnet from an integer type value ???