Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Is it possible to create a sub exclusive to a sub? (Leak free solution)

by ihb (Deacon)
on Sep 19, 2004 at 11:44 UTC ( [id://392170]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        use vars qw/ $REC /;
    
    ...
            local $REC = $_foo;
            $_foo->(@_);
        };
    
  2. or download this
        sub foo {
            no warnings 'redefine';
    ...
    
            return foo(@_);
        }
    
  3. or download this
        use vars qw/ $REC /;
        sub foo {
    ...
    
            return $REC->(@_);
        }
    
  4. or download this
        sub foo {
            no warning 'redefine'; # needed if the recursive sub calls any
    + other sub
    ...
    
            return _(@_);
        }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-25 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found