Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: RFC Getopt::Hash

by radiantmatrix (Parson)
on Aug 09, 2005 at 16:23 UTC ( [id://482288]=note: print w/replies, xml ) Need Help??


in reply to Re: RFC Getopt::Hash
in thread RFC Getopt::Hash

Yes, I missed that. However, that's only half of my purpose, as the other half is to get the options into a hash and set default values in one statement.

I shall make a note to update my POD to clarify that.

<-radiant.matrix->
Larry Wall is Yoda: there is no try{} (ok, except in Perl6; way to ruin a joke, Larry! ;P)
The Code that can be seen is not the true Code
"In any sufficiently large group of people, most are idiots" - Kaa's Law

Replies are listed 'Best First'.
Re^3: RFC Getopt::Hash
by BUU (Prior) on Aug 09, 2005 at 18:05 UTC
    Next can you make GO::L handle short and long options sanely?

      I believe it is already done: Getopt::Mixed. The syntax is slightly different from Getopt::Long, so it isn't a drop-in replacement. Also, by default, it exports a bunch of scalars into the calling package (bad, IMO) -- the non-default behavior is pretty nice, though:

      use Getopt::Mixed 'nextOption'; Getopt::Mixed::init('option1=s>o', 'option2:i>o2'); my %opt = ( option1 => 'default1', option2 => 'default2', ); while ( my ($k, $v) = nextOption() ) { $opt{$k} = $v } Getopt::Mixed::cleanup(); ## what's left is now in @ARGV

      Using nextOption lets you process serially, too, which can be nice sometimes.

      <-radiant.matrix->
      Larry Wall is Yoda: there is no try{} (ok, except in Perl6; way to ruin a joke, Larry! ;P)
      The Code that can be seen is not the true Code
      "In any sufficiently large group of people, most are idiots" - Kaa's Law

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2024-04-19 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found