Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^2: Little annoying mistakes ... of others

by toolic (Bishop)
on Dec 07, 2008 at 02:59 UTC ( #728634=note: print w/ replies, xml ) Need Help??

in reply to Re: Little annoying mistakes ... of others
in thread Little annoying mistakes ... of others

Along the sames lines, and much more likely, is to pass in a numeric option on the command line whose value is quite probably 0. For example, I have a histogram script in which I can pass in the minimum value. Unless I check the value using defined, the thing just doesn't work right:

use strict; use warnings; use Getopt::Std; our $opt_m; getopts('m:'); print "$opt_m\n" if ($opt_m); # Wrong #print "$opt_m\n" if (defined $opt_m); # Right

Comment on Re^2: Little annoying mistakes ... of others
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://728634]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2015-11-27 17:13 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (731 votes), past polls