in reply to How to call sub defined in a variable?
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] )->();
|
---|