use UNIVERSAL 'can'; my $sub = can "A::B::$ModName", "Sub"; if( $sub ){ $sub->($X); } my $res ; if( eval { $res= "A::B::$ModName::Sub"->($X); 1 } ){ return $res; }
In reply to Re: Check for sub / don't fail on non-existent sub
by Anonymous Monk
in thread Check for sub / don't fail on non-existent sub
by Sewi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |