%map = (0,"",1,1,2,21,3,321,4,4321,5,54321,6,654321,7,7654321,8,87654321, 9,987654321); while(<>){ s/(\d)/$map{$1}/eg; print; }
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page