Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: parsing multiple values with getopt::long

by karlgoethebier (Prior)
on Apr 28, 2014 at 11:52 UTC ( #1084118=note: print w/replies, xml ) Need Help??

in reply to parsing multiple values with getopt::long

You can also use a repeat specifier:

GetOptions ( "prueba2=s{1,}" => \@array, ) or die "not working: $!\n";

s{1,} means at least one. So you just need to type -p 1 2 3 instead of -p 1 -p 2 -p 3 - if like to save some energy ;-)

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1084118]
[Corion]: Heh - I just realized, $work management just declared "no raises for anybody this year", and I'm not even angry about that. Even though that implicitly means "raises for the people with an automatic 5% raise in their contract", which the newly-merged ...
[Corion]: ... coworkers have. But I guess I've gone more mellow since I get to relax more, and such stuff doesn't make me as angry as it used to.
[Corion]: $boss will still get to listen to my interpretation :-D
[Eily]: hey, I'm just behind Larry in SioB \o/

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2018-01-22 11:05 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (233 votes). Check out past polls.