in reply to hash o' refs

Why? Because that's the right syntax. The canonical invocation of a coderef is:
&{ THING_THAT_CONTAINS_A_CODE_REF }( @ARGS ) # (@ARGS) optional
Which would be your final line. You may drop the curly braces around THING_THAT_CONTAINS_A_CODE_REF if and only if the THING is a simple scalar variable. Yours is not.

As an alternative syntax, you may use

THING_THAT_CONTAINS_A_CODE_REF -> ( @ARGS )
which would be
$hash{test}->()
in your case. That last syntax is due to yours truly challenging chip to get it in during the final perl 5.004 gamma release, which he did. You're welcome. {grin}

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
RE: RE: hash o' refs
by Russ (Deacon) on Aug 08, 2000 at 03:12 UTC
    I am about to give this syntax the highest praise I can imagine:
    "Of course you can do that, how else would it work?"

    /me can think of no better compliment to any software feature.

    Russ
    Brainbench 'Most Valuable Professional' for Perl

RE: RE: hash o' refs
by Adam (Vicar) on Aug 08, 2000 at 02:44 UTC
    And I thank you!

    $hash{test}->();
    Looks a lot better then:
    &{$hash{test}}();