in reply to How to determine if a package method is defined
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...)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to determine if a package method is defined
by ikegami (Patriarch) on Oct 01, 2009 at 03:37 UTC | |
by almut (Canon) on Oct 01, 2009 at 03:58 UTC | |
by ikegami (Patriarch) on Oct 01, 2009 at 04:00 UTC |