Hi I'm quite new to perl. I have a perl hash containing subroutines. I've tried to run it in various ways that I found online. But nothing seems to work. My code :
%hashfun = (
start=>sub { print 'hello' },
end=>sub { print 'bye' }
);
And I've tried the following and more.
print "\n $hashfun{start} \n";
which results in the following output:
CODE(< HexaDecimal Value >)
Then I tried
print "\n $hashfun{start}->() \n";
which results in the following
CODE(< HexaDecimal Value >) ->()
How to fix?