in reply to Re: Subroutines reference from data
in thread Subroutines reference from data

&$key() if main->can($key);
is not strict safe, but:
if (my $sub = main->can($key)) { $sub->(); }
also nice (but maybe too obfuscated?) would be (main->can($key)||sub{})->();