in reply to How to check if a function exists within a package?
For functions, defined.
if ( defined( &perlmonk::funnyfunction ) )
For methods, can. Checks inheritance.
if ( perlmonk->can('funnyfunction') )
if ( $obj->can('funnyfunction') )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to check if a function exists within a package?
by jettero (Monsignor) on Sep 08, 2008 at 02:01 UTC | |
by ikegami (Patriarch) on Sep 08, 2008 at 02:11 UTC | |
|
Re^2: How to check if a function exists within a package?
by rapide (Beadle) on Sep 08, 2008 at 01:38 UTC |