Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Strict, strings and subroutinesby gbarr (Monk) |
on Oct 10, 2001 at 16:49 UTC ( [id://117982]=note: print w/replies, xml ) | Need Help?? |
Others have given you several solutions, but there is one more.
strict will only cause an error if you try to call the sub
by using a string. It does not stop you taking a reference. So
Is perfectly legal. But if you don't want the extra variable
will work too. But the benefit of using the variable is that you can check that the sub actually exists with
In Section
Seekers of Perl Wisdom
|
|