in reply to How to extract the first elemnet from an integer type value ???
my $digit = (split //, '100')[0];
Update or
my $num = 100; my $digit = int ($num / 10 ** int (log ($num) / log(10)));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to extract the first elemnet from an integer type value ???
by Leviathan (Scribe) on Aug 31, 2006 at 09:49 UTC | |
by GrandFather (Saint) on Aug 31, 2006 at 09:55 UTC | |
by Not_a_Number (Prior) on Aug 31, 2006 at 10:08 UTC | |
by GrandFather (Saint) on Aug 31, 2006 at 10:16 UTC | |
by Not_a_Number (Prior) on Aug 31, 2006 at 10:44 UTC | |
| |
by Leviathan (Scribe) on Aug 31, 2006 at 10:11 UTC |