in reply to Re^2: a simple exercise in readability
in thread a simple exercise in readability
# Command-line (my $x = shift) or die $syntax; (my $y = shift) or die $syntax; # Validity checking ($x =~ /^-?\d+$/) or die "$iam: value $x not an integer\n"; ($y =~ /^-?\d+$/) or die "$iam: value $y not an integer\n";
to
my $start = shift @ARGV; my $end = shift @ARGV;
It seems to me that you have gained more meaningful variable names but you have lost two forms of error checking, making your script less robust. You no longer detect if the user fails to supply enough arguments and you fail to validate those arguments that are supplied. Probably a backward step.
Cheers,
JohnGG
Update: As apotheon pointed out, I completely missed an element of his code. Please ignore this post.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: a simple exercise in readability
by apotheon (Deacon) on Jan 15, 2007 at 14:55 UTC | |
by johngg (Canon) on Jan 15, 2007 at 15:55 UTC |