http://www.perlmonks.org?node_id=197964


in reply to making a shorter code!

#!/usr/bin/perl -l print"Enter the distance to be converted:"; printf"$_ kilometers= %f miles\n$_ miles= %f kilometers",($_=<>)*0.621 +4,$_*1.609;

Is the shortest I could think of in a short period of time. At 144 bytes. The chomp seemed unecessary (Perl 5.6.1/Win32), and -l allowed me to skip \ns, and using printf allowed the three chars of %f and a commer, rather than "..". I didn't seem to get much benefit by using $m=miles or $m=' miles' tho.