It's a lot cleaner to use:
my $func_ref = main->can( $s );Checking that $func_ref is true should be sufficient. (Checking ref doesn't always work.)
In reply to Re^2: How to call subroutines using variables ?
by chromatic
in thread How to call subroutines using variables ?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |