in reply to Re: Begining Monk seeks Wisdom.......
in thread Begining Monk seeks Wisdom.......
The code above should do the trick...You weren't passing your switches into \%opts!use Getopt::Std; getopts('ed:', \%opts); if ($opts{e}) # updated as per [Chemboy] { print "option e used!\n"; } else { print "option e not used!\n"; }
use Getopt::Long; my %opt = (); GetOptions(\%opt, "file=s", ); die "No file specified : $!" unless $opt{file}; if ($opt{file}) { print "File is $opt{file}!\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Begining Monk seeks Wisdom.......
by void (Scribe) on May 04, 2001 at 19:33 UTC |