sfink is right. Also, japhy noticed recently that disabling strict references at the top of the scope there disables them inside the anonymous subroutine. It's better to declare the subroutine and then disable strict references and assign to the typeglob:
{ my $sub = sub { ... }; no strict 'refs'; *{ "${class}::get_${name}" } = $sub; }
In reply to Re^2: RFC: Perl Second-Best Practices
by chromatic
in thread RFC: Perl Second-Best Practices
by dimar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |