[JaxPM] Base 36 to Base 10
Bill -OSX- Jones
sneex at mac.com
Thu Feb 14 09:38:59 CST 2002
On the jacksonville-pm-list; Jax.PM'er Bill -OSX- Jones <sneex at mac.com> wrote -
This is the smallest I can make the code and still understand it
myself :)
#!perl
while(<DATA>){
chop;split//;for(@_){s#\D#-55+ord$&#e;$z=36*$z+$_}print"$z ";
$z = 0;
}
# Test Data results in:
# 671 58650 537321 33062788 1.37328123695135e+15 1185537 57980086
# respectively...
__END__
IN
1996
BILL
JONES
DISCOVERED
PERL
YIPPY
... and so on ...
By the way, would you like for me to explain how it works?
_Sx____________________
('> -Sx- IUDICIUM
//\ Have Computer -
v_/_ Will Hack...
Jax.PM Moderator's Note:
This message was posted to the Jacksonville Perl Monger's Group listserv.
The group manager can be reached at -- owner-jacksonville-pm-list at pm.org
to whom send all praises, complaints, or comments...
More information about the Jacksonville-pm
mailing list