Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: multiple entries per option (Getopt)

by Perlbotics (Canon)
on Jan 26, 2012 at 20:51 UTC ( #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";

Comment on Re: multiple entries per option (Getopt)
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (13)
As of 2015-11-24 23:52 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (666 votes), past polls