in reply to Re: Calling a function reference with arguments
in thread Calling a function reference with arguments

I get:

syntax error at noname.pl line 2, near "%hash{" Execution of noname.pl aborted due to compilation errors.

with:

my %hash = (hello => "Hello World\n", my_function => \&my_func); my $func_ref = %hash{"my_function"}; $func_ref-> (\%hash); sub my_func { my $hashref = shift; print $hashref->{hello} }

so it seems the sample code you provided is not quite the same as the code you tested, or there is a Perl version difference issue perhaps? (I'm using AS Perl v5.8.7)


DWIM is Perl's answer to Gödel