Using this kind of test, you can check for other stuff, like GLOB, filehandles and such, which aren't easily prefixed with something like '$', '&', '%' or '@'.sub foo { } foreach (qw[ foo bar ]) { print "$_? ",(defined(*$_{CODE})? "defined":"undef"), "\n"; }
In reply to Re: Test for Subroutine Definition
by tadman
in thread test for subroutine existence
by twerq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |