Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Aliasing values, not variablesby calin (Deacon) |
on Jul 18, 2004 at 18:31 UTC ( [id://375410]=note: print w/replies, xml ) | Need Help?? |
Lexical::Alias is not suited for this task. Try Array::RefElem instead:
If you're bent on using Lexical::Alias, you can try the following trick for your particular situation, though it's of little use for generic array element aliasing. It's an answer to the first question from How's your Perl?, adapted to Lexical::Alias.
Warning: code untested!. I don't have my laptop which has my custom Perl install with Lexical::Alias and Array::RefElem. Particularly the second example might not work as advertised. update: a monk confirms that code works on CB
In Section
Seekers of Perl Wisdom
|
|