Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: easiest way to read multiple word command arguments

by toolic (Bishop)
on Aug 15, 2013 at 16:15 UTC ( #1049622=note: print w/replies, xml ) Need Help??


in reply to easiest way to read multiple word command arguments

Options with multiple values
Warning: What follows is an experimental feature.
use warnings; use strict; use Getopt::Long; use Data::Dumper; my @aopt; my @bopt; GetOptions( 'a=s{1,}' => \@aopt, 'b=s{1,}' => \@bopt, ) or die; print Dumper(\@aopt); print Dumper(\@bopt); __END__ my_script.pl -a sf -b asdad dfsdf $VAR1 = [ 'sf' ]; $VAR1 = [ 'asdad', 'dfsdf' ];

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2022-12-04 06:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?