Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: The correct way to redefine a routine

by Fletch (Bishop)
on Mar 28, 2008 at 17:49 UTC ( [id://677070]=note: print w/replies, xml ) Need Help??


in reply to The correct way to redefine a routine

package My::Foo::Bar; use base 'Foo::Bar'; sub do_magic { my $self = shift; my $orig_ret = $self->SUPER::do_magic( @_ ); ### Do rest of magic here. return $actual_ret_value; }

Season accordingly if your magic needs to be done before the superclass' magic.

The cake is a lie.
The cake is a lie.
The cake is a lie.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2024-04-19 21:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found