Subject: | Getopt::Long::Descriptive usage question |
Date: | Fri, 14 May 2010 23:49:27 -0400 |
To: | bug-getopt-long-descriptive [...] rt.cpan.org |
From: | "David J. Biesack" <David.Biesack [...] sas.com> |
Thanks for your Getopt::Long::Descriptive module.
I have a quick question: when I use the '@' option for multiple args:
my ($commandLine, $usage) = describe_options
(
'%c %o command [commands...]',
[ 'java-opt|j:s@', "Java runtime options"],
);
@java_opt = $commandLine->java_opt();
then invoking with
mycmd -j a -j b -j c
the call
$commandLine->java_opt();
returns an ARRAY object, not a list of the values.
That is, after
@java_opt = $commandLine->java_opt();
printf("@java_opt , last is %d, elt 0 is %s\n", $#java_opt, $java_opt[0]);
this prints as
ARRAY(0x109a9db0) , last is 0, elt 0 is ARRAY(0x109a9db0)
How do I get to the elements, i.e. each of the values from the command line?
(The Getopt::Long module works and returns a decomposable array,
but lacks the features of Getopt::Long::Descriptive.)
thanks for any help,
djb
--
David J. Biesack, SAS
SAS Campus Dr. Cary, NC 27513
www.sas.com (919) 531-7771