Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Hijacking a method

by Transient (Hermit)
on Jun 17, 2009 at 16:27 UTC ( [id://772462]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $obj->doSomething();
    
  2. or download this
    $myFunkyLogMachine->Log("hi!");
    $obj->doSomething();
    $myFunkyLogMachine->Log("bye!");
    
  3. or download this
    *obj::doSomething2 = \&obj::doSomething;
    *obj::doSomething = sub { $myFunkyLogMachine->Log("hi!"); $obj->doSome
    +thing2(@_); $myFunkyLogMachine->Log("bye!"); }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-24 05:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found