Sun751 has asked for the wisdom of the Perl Monks concerning the following question:
In below code I am checking if $options are defined or not, if
not then i am assigning respective file name to variables
but without defined it work but with defined i am getting 1
as a value for variable rather than actual value,
Any suggestion?please,
my $source_file= defined($options{o}) || 'as.xcf-dist'; my $config_file= defined($options{c}) || 'config.ini'; my $dest_file= defined($options{x}) || usage();
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: checking $option
by targetsmart (Curate) on Jun 26, 2009 at 05:02 UTC | |
Re: checking $option
by ikegami (Patriarch) on Jun 26, 2009 at 07:34 UTC | |
Re: checking $option
by citromatik (Curate) on Jun 26, 2009 at 07:38 UTC | |
Re: checking $option
by leslie (Pilgrim) on Jun 26, 2009 at 05:13 UTC | |
Re: checking $option
by Anonymous Monk on Jun 26, 2009 at 05:03 UTC | |
Re: checking $option
by toolic (Bishop) on Jun 26, 2009 at 13:32 UTC |
Back to
Seekers of Perl Wisdom