in reply to Check for sub / don't fail on non-existent sub
my $sub_x = 'Some::Sub'; my $Result = 'Bad'; if (exists &{$sub_x} && (ref $sub_x eq 'CODE' || ref $sub_x eq '')) { $Result = 'Good'; } print $Result . "\n"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Check for sub / don't fail on non-existent sub
by ikegami (Patriarch) on Aug 29, 2009 at 12:41 UTC | |
by Sewi (Friar) on Aug 29, 2009 at 18:51 UTC |