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
I've met a couple of them, they are not what I would characterize as human, perhaps super-human.
Maybe I should elaborate on these scripts. They were conversions from python, and only accept integers and only return integers. They all look similar except for the operator, and are as follows:
if ($#ARGV != 1) { die "Usage: div numerator denominator\n" } foreach (@ARGV) { die "Integers only\n" if (/\D+/); } my $tot = sprintf "%lf\n", ($ARGV[0]/$ARGV[1]); $tot =~ s/(\d+)(\.\d+)/$1/; print $tot;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Syntactical changes in Perl 5.8 from 5.6.1
by Abigail-II (Bishop) on Oct 11, 2003 at 00:38 UTC | |
by sweetblood (Prior) on Oct 14, 2003 at 16:52 UTC | |
by Abigail-II (Bishop) on Oct 14, 2003 at 19:11 UTC |