Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

by toolic (Chancellor)
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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2014-08-21 06:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (128 votes), past polls