in reply to Syntax to call a subroutine from a reference

you almost had it:
$x->{'result'} = &{$x->{'subname'}}();
Update: See perlref, especially example 2 in the "Using References" section.

Update: As herveus notes, your original way of $x->{'result'} = $x->{'subname'}->(); does work as well...

Replies are listed 'Best First'.
Re^2: Syntax to call a subroutine from a reference
by herveus (Prior) on Sep 21, 2005 at 18:17 UTC
    Howdy!

    $x->{subname}->() (as seen in the original code) also works fine. In fact, I would tend to prefer that over using the ampersand sigil.

    yours,
    Michael