Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: method aliases with goto(&NAME)

by tobyink (Abbot)
on Sep 18, 2013 at 13:26 UTC ( #1054651=note: print w/ replies, xml ) Need Help??


in reply to Re^2: method aliases with goto(&NAME)
in thread method aliases with goto(&NAME)

There are probably instances where you'd want two methods that behave identically in the parent class, but behave differently in the child class. However, given that the title of this thread mentioned "method aliases", I'm assuming the intention is that legacy_method acts as an alias (i.e. behaves identically) for current_method, unless a child class explicitly overrides legacy_method to make it behave differently.

use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name


Comment on Re^3: method aliases with goto(&NAME)
Select or Download Code
Replies are listed 'Best First'.
Re^4: method aliases with goto(&NAME)
by LanX (Chancellor) on Sep 18, 2013 at 14:53 UTC
    I had the impression that legacy_method is supposed to be deprecated and that overloading in new children is maybe not intended.

    Well I don't like speculating about the OPs intention, let's wait what he says... :)

    Cheers Rolf

    ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2016-02-11 03:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (358 votes), past polls