in reply to Re: Issue with multiple options for a Getopt::Long argument
in thread Issue with multiple options for a Getopt::Long argument
That is a reference to a COPY of @option_array.
No, nothing is being copied.
In list context, \(@array) is equivalent to \($array[0], $array[1], ..., $array[-1]), which is equivalent to \$array[0], \$array[1], ..., \$array[-1].
In scalar context, \(@array) is equivalent to \($array[0], $array[1], ..., $array[-1]), which is equivalent to \$array[-1].
The above also applies to \(our @option_array). The OP wants \our @option_array (no parens), which returns a reference to the array.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Issue with multiple options for a Getopt::Long argument
by Anonymous Monk on Jan 24, 2018 at 17:39 UTC |