Posted on 2006-07-11 07:55:39-07
by jvromansin response to 1633
Re: pushing options into an array ref. possible?
That's where user defined destination routines can be used for:
use Getopt::Long;
use strict;
my $var;
my $list;
GetOptions
('var=s' => \$var,
'list=s%' => sub { push(@{$list->{$_[1]}}, $_[2]) },
);
use Data::Dumper;
print Dumper $list;