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

Re^2: RFC Getopt::Hash

by radiantmatrix (Parson)
on Aug 09, 2005 at 16:23 UTC ( #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
Node Status?
node history
Node Type: note [id://482288]
help
Chatterbox?
[marto]: good morning all

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2018-07-17 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (358 votes). Check out past polls.

    Notices?