Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Subroutines reference from databy chip (Curate) |
on Mar 22, 2004 at 23:02 UTC ( [id://338815]=note: print w/replies, xml ) | Need Help?? |
For most purposes, the UNIVERSAL::can method will serve:
if (my $code = main->can($key)) { &$code() }; If you don't mind turning off strict 'refs', there's the ever-popular defined: &$key() if defined &$key; edited: to make the first example strict-safe. Thanks, tinita. -- Chip Salzenberg, Free-Floating Agent of Chaos
In Section
Seekers of Perl Wisdom
|
|