
rovf
Veteran
Nov 10, 2010, 3:10 AM
Post #5 of 6
(4217 views)
|
Re: [gooroo175] reference on reference array
[In reply to]
|
Can't Post
|
|
I think I understand. To say it otherwise: You have a set of variables $v1, $v2, $v3,...., and are looking for a neat way to construct a reference to an array containing references to variables, i.e. [\$v1,\$v2,\$v3,...]. Is this correct? You could do it like this: my $ref_to_array_containing_refs = map { \$_ }($v1,$v2,$v3); The trick works, because $_ is an alias to the respective array element, not a copy.
|