in reply to Little annoying mistakes ... of others
szabgab,
I am sure I could come up with a laundry list but my mind is on other things (family isn't feeling well). The one that bugs me is not considering defined values that evaluate to false when setting up a conditional. Since I am guilty of this, let me give an example:
I am sure I could come up with a laundry list but my mind is on other things (family isn't feeling well). The one that bugs me is not considering defined values that evaluate to false when setting up a conditional. Since I am guilty of this, let me give an example:
#!/usr/bin/perl use strict; use warnings; my $file = $ARGV[0] or die "Usage: $0 <input_file>"; open(my $fh, '<', $file) or die "Unable to open '$file' for reading: $ +!";
While I think it is uncommon that someone would name their file '0', it is possible. In other examples, the oversight might be the empty string ''. As a reference, see True and False (aka Booleans). I know that 5.10 introduced the // operator which is great.
Cheers - L~R
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Little annoying mistakes ... of others
by toolic (Bishop) on Dec 07, 2008 at 02:59 UTC |
In Section
Meditations