Not exactly sure whether you meant $TEST or TEST, but maybe you want
if ( defined &TEST::test_sub ) { # package TEST if ( defined &{"${TEST}::test_sub"} ) { # package in $TEST
(The One :) difference between defined &{"${TEST}::test_sub"} and $TEST->can("test_sub") is
that the latter would consider inheritance, while the former would not
— so which one to use depends on what exactly you want...)
In reply to Re: How to determine if a package method is defined
by almut
in thread How to determine if a package method is defined
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |