note
Perlbotics
<p>
You could feed your examples to the following program and see what happens...
The important part is the <c>"o=s"</c> telling Getopt to look for <em>-o</em> switches with a <em>s</em>tring argument and the array-ref telling it
to accumulate the -o arguments into an array.
</p>
<p>
<code>
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";
</code>
</p>
950214
950214