Syntactic Confectionery Delight | |
PerlMonks |
RE (tilly) 2: Validating a Code Referenceby tilly (Archbishop) |
on Aug 17, 2000 at 20:26 UTC ( [id://28325]=note: print w/replies, xml ) | Need Help?? |
Very nice! OTOH I use anon subs a lot, and this approach will fail for those. Incidental note. After some testing it appears that if the sub exists when you define the sub reference, you get the first sub. Otherwise you get the first sub defined after that with that name. I tried various combinations of evals creating refs, defining subs, redefining subs, and that seemed to be what happened. Personally I would not worry about it. But I would like it if "strict 'subs'" disallowed making a reference to a sub that is not yet defined...
In Section
Seekers of Perl Wisdom
|
|