in reply to Re^3: How to tell methods exist in a package
in thread How to tell methods exist in a package

No, but this does:

$val="FOO"; $method="${val}::mySub"; if (exists &$method) {...}

Also,

if ($val->can("mySub")) { ... }

works (with the aforementiond behavioural differences of course).


Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -- Brian W. Kernighan

Replies are listed 'Best First'.
Re^5: How to tell methods exist in a package
by jeanluca (Deacon) on Nov 21, 2005 at 19:35 UTC
    very nice!!!, I prefer the one with can(..)!!

    Cheers
    Luca