A pity you don't cache the possibility that it doesn't exist:
JeroenBEGIN { my %cache; sub do_it { my $func = shift; $cache{$func} = do { local @ISA; __PACKAGE__->can("do_$fun") } unless exist $cache{$func}; $cache{$func}->(@_); } }
Update: merlyn is right. Fixed that.
In reply to Re:{3} Strict, strings and subroutines
by jeroenes
in thread Strict, strings and subroutines
by hatter
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |