http://qs321.pair.com?node_id=270361


in reply to Alpha base-26 to base-10...

Not as short but a bit clearer (to me, anyway) than the others I've seen:
sub b26_to_b10 { my @digits = reverse split //, shift; my $i = 1; my $result = 0; for ( @digits ) { $result += ( ord(lc($_)) - ord('a') + 1 ) * $i; $i *= 26; } return $result; }


Christopher E. Stith