Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

How to fool caller() / use NEXT within a dynamic sub

by betterworld (Curate)
on Jul 26, 2005 at 18:49 UTC ( [id://478324]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use NEXT;
    
    no strict 'refs';
    ...
      # do something
      $this->NEXT::function(@_);
    };
    
  2. or download this
    sub printcaller {
      my $caller = (caller(1))[3];
      print "$caller\n";
    ...
    };
    
    testpackage::function();
    
  3. or download this
    sub printcaller {
      my $caller = (caller(1))[3];
      print "$caller\n";
    ...
    };
    
    testpackage::function(); # Output: testpackage::function
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-25 15:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found