Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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" ;

-- '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?

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2015-11-26 06:09 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 (696 votes), past polls