in reply to Hash reference

is xyz your key? or is it x, then y, then z?

Have you tried:
$w = "xyz"; &myfunc($a_ref->{$w});
??

Replies are listed 'Best First'.
Re^2: Hash reference
by koknat (Sexton) on Jun 03, 2005 at 23:27 UTC
    Thanks very much. That worked. I didn't think the braces were needed, but they make all the difference.
    &myfunc($a_ref->$w); # BAD &myfunc($a_ref->{$w}); # GOOD
    Yes, "xyz" was the key.
      The braces are indeed important because you're providing a key, and expecting a value. The value is actually a reference!

      When you don't provide the braces you are no longer passing a key and expecting a value. Instead you're trying to call a function!

      That's why you get the error message, can't call method on unblessed reference.. because you have a hash, not an object.