Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 cooling their heels in the Monastery: (9)
As of 2015-07-04 10:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (59 votes), past polls