in reply to variable interpolation while dereferencing

The only way that would do what you want it to is with the use of eval
$ref = { "person" => { "name" => "Bob" } }; # this works print $ref->{person}{name}; # this does $n = '{person}{name}'; eval 'print $ref->'.$n;
I think Zaxo got your ticket though ;)

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

    Your answer is certainly right, but please don't forget to point out all the madness that lies that way when you post something like that.

    Update: everyone knows things you can cut yourself with are dangerous. But not everyone knows which things you can cut yourself with, yet.

    Makeshifts last the longest.