Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

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

by duelafn (Parson)
on Feb 12, 2020 at 12:46 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11112864]
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: (9)
As of 2024-03-28 09:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found