![]() |
|
We don't bite newbies here... much | |
PerlMonks |
Re^5: Use of uninitialized value $_ in stringby AnomalousMonk (Archbishop) |
on Apr 06, 2014 at 19:54 UTC ( #1081330=note: print w/replies, xml ) | Need Help?? |
... adding the backslash before the &usage(). I'm sure you understand this, but just in case... Just adding a backslash in front of a subroutine invocation will cause a reference to be taken to whatever the subroutine happens to return when invoked.
Of course, the correct expression for assigning a code reference to a hash key would be
(Also, it's better practice to invoke subroutines without the & sigil due to certain occasional, unexpected side-effects. So rather than
In Section
Seekers of Perl Wisdom
|
|