Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: multiple entries per option (Getopt)

by Perlbotics (Archbishop)
on Jan 26, 2012 at 20:51 UTC ( [id://950218]=note: print w/replies, xml ) Need Help??


in reply to multiple entries per option (Getopt)

You could feed your examples to the following program and see what happens... The important part is the "o=s" telling Getopt to look for -o switches with a string argument and the array-ref telling it to accumulate the -o arguments into an array.

use strict; use warnings; use Getopt::Long; my @o_list; unless ( GetOptions ("o=s" => \@o_list) ) { print "GetOptions had problems parsing ARGV!\n"; } print "List of -o things: ", join(", ", @o_list), "\n"; print "Unparsed arguments: ", join(", ", @ARGV ), "\n";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-04-16 18:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found