Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 romping around the Monastery: (12)
As of 2015-08-28 07:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (335 votes), past polls