You might also find some useful ideas in calling subroutines from variables. For instance,
my $sub_i_want_to_call = $ary[rand @ary]; my $sub_ref = __PACKAGE__->can( $sub_i_want_to_call ); $sub_ref->();
Or, without the variables,
__PACKAGE__->can( $ary[rand @ary] )->();
In reply to Re: How to call sub defined in a variable?
by kyle
in thread How to call sub defined in a variable?
by jh-
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |