in reply to making a shorter code!
I don't do this kind of thing much and tend
not to recommend it to beginners. That is my bias.
I think there are two paths to Perlish wisdom
,
on one you will, if necessary, flip hamburgers for minimum
wage to buy disk space and random access memory
to avoid having to scrunch beauteous code into small
spaces.
The short path is to sit in front of the keyboard
and learn all the weirdities of perl.
The short path is only shorter in that you sit in
one place a lot.
Perhaps if you can come and go at the same time. And
hear the difference between a symbol table alias
and hard ref. Then you should take both paths.
The nature of the enlightenment achieved varies depending
upon which path you take.
#!/usr/bin/perl -l print"Enter the distance to be converted:"; $_=<>; chomp; $k=" kilometers"; $m=" miles"; print"$_$k= ".$_*0.6214."$m\n$_$m= ".$_*1.609."$k";
|
---|