Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Is modifying the symbol table to redefine subroutines evil?

by sfink (Deacon)
on Apr 15, 2007 at 15:42 UTC ( #610206=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      no strict 'refs';
      my $pkg = caller;
      *{ $pkg . "::foo" } = sub { ... }; # the final foo
    
  2. or download this
    sub foo {
      our $CALL_COUNT;
      call_me_only_once() unless $CALL_COUNT++;
      ...do stuff...
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-08-20 09:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (108 votes), past polls