Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: checking $option

by targetsmart (Curate)
on Jun 26, 2009 at 05:02 UTC ( #774913=note: print w/ replies, xml ) Need Help??


in reply to question about getopt

from defined
Returns a Boolean value telling whether EXPR has a value other than the undefined value undef. If EXPR is not present, $_ will be checked.

you are getting a true boolean value 1, which means when the option is present, you are just storing the return value of defined($options{o})

try ? :

my $source_file = defined($options{o}) ? "<some filename>" : "as.xcf-d +ist" ;


Vivek
-- 'I' am not the body, 'I' am the 'soul', which has no beginning or no end, no attachment or no aversion, nothing to attain or lose.


Comment on Re: checking $option
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2014-12-22 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (112 votes), past polls