On 22 Sep 2006 20:43:51 -0700, Jack <> wrote:
> I am reading in arguments just fine using the code below, but I want to
> be able to add a variable number of values into an argument into perl -
>
> I want to be able to say
> perl -f value1 value2 ..valueN -v value value2 ..valueN
>
> and store the values of -f in a single array, and -v also (and the
> number of passed values could vary !)
I've just discovered the clever Getopt:

eclare module, which can do
just that:
#/usr/bin/perl
use strict;
use warnings;
use Getopt:

eclare;
my $args = Getopt:

eclare->new(<<END);
-f <value>... a list of values
-v <value>... another list of values
END
my @f = @{ $args->{'-f'} };
my @v = @{ $args->{'-v'} };
print "f = @f, v = @v\n";