Perl-Sensitive Sunglasses | |
PerlMonks |
How do I process then return something in Moose?by dr_death (Novice) |
on Feb 07, 2017 at 11:24 UTC ( [id://1181282]=perlquestion: print w/replies, xml ) | Need Help?? |
dr_death has asked for the wisdom of the Perl Monks concerning the following question: Hello all, I am pretty new to OOP programming and am trying to learn how to use Moose and I cant seem to find an example/explanation of what I need to do, although I am learning a lot reading through trying to find it. What I am trying to do is create a new object like below and then have that return an ID from a DB. get_id->new( email => 'test@test.com' );I have something like the below already;
I've seen 'default => sub', but I'm not entirely sure if it's appropriate or how the inheritance works using it. Is there someway I can call a sub or method and have it return the ID? If so, could you please tell me where I can find it in the documentation? Thanks for your help!
Back to
Seekers of Perl Wisdom
|
|