in reply to making a shorter code!
For this example you could take advantage of the -l switch to Perl (see perldoc perlrun) to get rid of some line noise (pay attention to the shebang line):#!/usr/bin/perl -w use strict; print "Enter the distance to be converted:\n"; chomp($_=<>); print "$_ kilometers= ", $_*0.6214, "miles\n", "$_ miles= ", $_*1.609, " kilometers\n";
#!/usr/bin/perl -wl use strict; print "Enter the distance to be converted:"; $_=<>; print "$_ kilometers= ", $_*0.6214, "miles"; print "$_ miles= ", $_*1.609, " kilometers";
Makeshifts last the longest.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: making a shorter code!
by mowgli (Friar) on Sep 15, 2002 at 02:12 UTC | |
by Aristotle (Chancellor) on Sep 15, 2002 at 07:27 UTC |