in reply to Re: Check for sub / don't fail on non-existent sub
in thread Check for sub / don't fail on non-existent sub

Simpler:
my $sub_x = 'Some::Sub'; if (defined(&$sub_x)) { print("It's there\n"); } else { print("It's not there\n"); }

Replies are listed 'Best First'.
Re^3: Check for sub / don't fail on non-existent sub
by Sewi (Friar) on Aug 29, 2009 at 18:51 UTC
    Wow, I expected that defined() would be applyed to the result of $sub_x, but a test showed that it doesn't.
    Thank you all!