Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Raku question: "Moose is Perl", but it sure ain't Raku.

by duelafn (Vicar)
on Feb 12, 2020 at 12:46 UTC ( #11112864=note: print w/replies, xml ) Need Help??


in reply to Raku question: "Moose is Perl", but it sure ain't Raku.

There may be a better way, but you can do this by overriding new (and removing the title attribute from Employee::Former):

class Employee::Former is Employee { method new(*%params) { %params<title> //= 'Team Member'; return callwith(|%params); } method name_and_title { my $old = callsame; return "$old (Former)"; } }

Good Day,
    Dean

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2021-03-07 12:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (121 votes). Check out past polls.

    Notices?