in reply to Re: Begining Monk seeks Wisdom.......
in thread Begining Monk seeks Wisdom.......

First, use code tags to format your code when you post it. See the FAQ for details.

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"; }
The code above should do the trick...You weren't passing your switches into \%opts!

UPDATE:
Hmm i am stumped. Use Getopt::Long, it's cooler anyhoo :P
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"; }


Azatoth a.k.a Captain Whiplash

Make Your Die Messages Full of Wisdom!
Get YOUR PerlMonks Stagename here!
Want to speak like a Londoner?

Replies are listed 'Best First'.
Re: Re: Re: Begining Monk seeks Wisdom.......
by void (Scribe) on May 04, 2001 at 19:33 UTC
    Well, it must be me. I copied your code and all i get is "option e used!" now matter what option I give it.

    "The Universe is not only more complex than we imagine, it is more complex than the can imagine." - Albert Einstein