Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: parsing multiple values with getopt::long

by karlgoethebier (Curate)
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»


Comment on Re: parsing multiple values with getopt::long
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2014-10-21 11:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (100 votes), past polls