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

chop $num until length $num == 1;
  • Comment on Re^6: How to extract the first elemnet from an integer type value ???
  • Download Code

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

    DWIM is Perl's answer to Gödel