#!/usr/bin/perl -w =pod lsd - little secret decoder - 28 sep 2003 decodes and prints decimal value of three digit little-endian, base 36 sequence number. feel free to cut and paste this code as you wish. =cut use strict; my $n = 0; my %m = (); my $c; for $c ( split '', '0123456789abcdefghijklmnopqrstuvwxyz' ) { # print "$c "; $m{ $c } = $n++; } $ARGV[ 0 ] or die "arg!"; my $arg = $ARGV[ 0 ]; my $ans = 36 * 36 * $m{ substr( $arg, 2, 1 ) } + 36 * $m{ substr( $arg, 1, 1 ) } + $m{ substr( $arg, 0, 1 ) }; print "$ans";