in reply to Re: Syntactical changes in Perl 5.8 from 5.6.1
in thread Syntactical changes in Perl 5.8 from 5.6.1
#!/usr/bin/perl -w use strict; if ($#ARGV != 1) { die "Usage: mult integer integer\n" } foreach (@ARGV) { die "Integers only\n" if (/\D+/); } my $tot = sprintf "%lf\n", $ARGV[0] * $ARGV[1]; $tot =~ s/(\d+)(\.0+)/$1/; print $tot;
Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Syntactical changes in Perl 5.8 from 5.6.1
by Abigail-II (Bishop) on Oct 14, 2003 at 19:11 UTC |