in reply to Re: How do I test the validity of a CODE reference?
in thread How do I test the validity of a CODE reference?

couldn't you just do
if ( my $sub = main->can($subname) ) { $sub->(...) }
?

Replies are listed 'Best First'.
Re^3: How do I test the validity of a CODE reference?
by ikegami (Patriarch) on Aug 10, 2008 at 13:27 UTC
    Not quite. can is meant for methods, so it obeys inheritance.