sub get_coderef { my $subname = shift; my $coderef; no strict 'refs'; $coderef = *{"$subname"}{CODE}; return $coderef if ($coderef and defined(&$coderef)); }