in reply to variable interpolation while dereferencing
I think Zaxo got your ticket though ;)$ref = { "person" => { "name" => "Bob" } }; # this works print $ref->{person}{name}; # this does $n = '{person}{name}'; eval 'print $ref->'.$n;
update: Just because you've been shown you have to use a knife, doesn't mean you also have to be told "Hey, don't cut your fingers off."
I did not forget, everybody knows its inherently dangerous.
____________________________________________________
** The Third rule of perl club is a statement of fact: pod is sexy.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: variable interpolation while dereferencing
by Aristotle (Chancellor) on Oct 27, 2002 at 14:38 UTC |