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 reply to Re: Subroutines reference from data
by chip
in thread Subroutines reference from data
by Syrkres
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |