in reply to Elegant way to dereference an array or hash?
It is possible (but not necessarily a good idea) to avoid that, using Typeglobs:
The obscurity vs efficiency of this kind of code might be a worthwhile tradeoff if run frequently, and/or with large arrays, when used correctly, and documented.my $foo = {bar=>{baz=> [3,4,5,6]}}; local *baz= $foo->{bar}{baz}; # typeglob ALIAS, not a copy print qq(@baz);
Earth first! (We'll rob the other planets later)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Elegant way to dereference an array or hash?
by waswas-fng (Curate) on Nov 17, 2004 at 01:23 UTC |