in reply to Re:{3} Strict, strings and subroutines
in thread Strict, strings and subroutines
This does precisely what mine does. Did you mean "exists" there instead of "defined"?BEGIN { my %cache; sub do_it { my $func = shift; $cache{$func} = do { local @ISA; __PACKAGE__->can("do_$fun") } unless defined $cache{$func}; $cache{$func}->(@_); } }
In Section
Seekers of Perl Wisdom