# base string $a='-40300aa03aa01aa02-4-1-2-40503aa-4aaaaa02a-400ab-4-1-2aa-2aba-404-4-1-2a-400-40503-40505a-403ab-4a-4-4a-1'; print "a1:$a\n"; # change base, sub with more 4xxxxx's $a=~s/b/-4aaa00/g; print "a2:$a\n"; # change again $a=~s/a/-3/g; print "a3:$a\n"; # change again, \ un-necessary $a=~s/\s//g; print "a4:$a\n"; # start a big substitution, in fact change to '.' sep dec ASCII chr for(0..77){ $b.='.' unless ($_*2)%3; print "$b\n"; $b.=4 + substr($a,$_*2,2); print "$b\n"; } # here is a one liner to print it out # just a . split print chr routine print chr $1 while $b=~/([^.]+)\./g # this is the rest of the code, which basically # generates the short code above then evals it #$b=~ s/\./),chr(/g; #$b=~s/^\),/print/; #$b=~s/0(\d\d)/$1/g; #eval($b.')');