in reply to Re: Sub ref from string without eval
in thread Sub ref from string without eval
Which is generalized even better as:
my $sub_ref = __PACKAGE__->can($x);
my @a=qw(random brilliant braindead); print $a[rand(@a)];
In Section
Seekers of Perl Wisdom