in reply to trouble acessing array result from GetOptions
Umm, using too much vertical white space? Not saying what you expected to see? Printing a reference rather than dereferencing it?
If the latter is the problem then try this version (note the @$value in the print):
use strict; use warnings; use Getopt::Long; my $key; my $value; my %options; GetOptions (\%options, 'names:s@', 'address:s@'); while (($key, $value) = each %options) { print "$key = @$value\n"; }
Prints:
names = Manny
Or using -names Manny -names Meany -names Minnie on the command line it prints names = Manny Meany Minnie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: trouble acessing array result from GetOptions
by dark314 (Sexton) on Jul 21, 2006 at 04:23 UTC | |
by davido (Cardinal) on Jul 21, 2006 at 04:31 UTC | |
by GrandFather (Saint) on Jul 21, 2006 at 04:26 UTC |