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

Re: Re: Begining Monk seeks Wisdom.......

by azatoth (Curate)
on May 04, 2001 at 18:37 UTC ( [id://77959]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-04-18 17:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found