in reply to Re^3: How to extract the first elemnet from an integer type value ???
in thread How to extract the first elemnet from an integer type value ???

my $digit = chop ( my $mun = reverse $num );
  • Comment on Re^4: How to extract the first elemnet from an integer type value ???
  • Download Code

Replies are listed 'Best First'.
Re^5: How to extract the first elemnet from an integer type value ???
by GrandFather (Saint) on Aug 31, 2006 at 10:16 UTC
    chop $num while $num > 9;

    DWIM is Perl's answer to Gödel
      chop $num until length $num == 1;
        $digit = chop $num while $num;

        DWIM is Perl's answer to Gödel