Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

(jeffa) Re: Setting default values in getopts

by jeffa (Bishop)
on Mar 27, 2002 at 15:01 UTC ( #154682=note: print w/replies, xml ) Need Help??


in reply to Setting default values in getopts

You can't redeclare a variable with my as you are doing. In fact, the better way to declare %opt is with use vars, like so:
use vars qw(%opt); $opt{d} = "x"; $opt{a} = "0"; $opt{s} = "0"; $opt{e} = "x"; getopts("dase:", \%opt);
Good luck!

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: (jeffa) Re: Setting default values in getopts
by neilwatson (Priest) on Mar 27, 2002 at 15:06 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2021-03-03 15:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (80 votes). Check out past polls.

    Notices?