Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re:{3} Strict, strings and subroutines

by merlyn (Sage)
on Oct 10, 2001 at 19:45 UTC ( #118021=note: print w/ replies, xml ) Need Help??


in reply to Re:{3} Strict, strings and subroutines
in thread Strict, strings and subroutines

BEGIN { my %cache; sub do_it { my $func = shift; $cache{$func} = do { local @ISA; __PACKAGE__->can("do_$fun") } unless defined $cache{$func}; $cache{$func}->(@_); } }
This does precisely what mine does. Did you mean "exists" there instead of "defined"?

-- Randal L. Schwartz, Perl hacker


Comment on Re: Re:{3} Strict, strings and subroutines
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://118021]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (8)
As of 2014-11-27 08:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (182 votes), past polls