in reply to Re^3: How to call a sub reff from a hash
in thread How to call a sub ref from a hash

Yes, but I'm trying to access an element of that hash.

Replies are listed 'Best First'.
Re^5: How to call a sub reff from a hash
by ikegami (Patriarch) on Dec 15, 2008 at 22:17 UTC

    Your wrong code:

    $Procedures->{$Procedure}($Parameter); ^^^^^^^^^^^ Not a hash. Undeclared and uninitialized scalar.

    The correct code:

    $Procedures{$Procedure}->($Parameter); ^^^^^^^^^^^^^^^^^^^^^^^ Element of a hash
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^5: How to call a sub reff from a hash
by Fletch (Bishop) on Dec 15, 2008 at 22:16 UTC

    Then you want to re-read perldata and perlreftut because $foo->{'bar'} has nothing to do with trying to get at $foo{'bar'}.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

      Originally I had: &$Procedures{$Procedure}($Parameter); but that gives me the same error.