Posted on 2006-07-11 07:55:39-07 by jvromans in 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;
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.