in reply to strange code (de)referencing behavior

Calling a subroutine this way
&{...}
forwards the @_ arguments. (Try sub f { say while $_ = shift; warn "Called\n" } %d = (1 => \&f); sub g { &{$d{1}} }; g(1, 2).) If you want to avoid that, use -> for dereference:
$dispatchTable{$fname}->();

Replies are listed 'Best First'.
Re^2: strange code (de)referencing behavior
by ikegami (Patriarch) on Feb 10, 2012 at 19:26 UTC

    Although I do prefer the arrow notation, the minimal change solution is actually

    &{$dispatchTable{$fname}}()