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

Re: OO Pattern Container x Elements and Method Chaining (House, Person, Inhabitant)

by LanX (Saint)
on Oct 08, 2021 at 16:51 UTC ( [id://11137360]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    Container      = SharedHouse
    Element        = Person
    ->do_something = ->pay_rent
    
  2. or download this
    my $cont = SharedHouse->new('Prag');
    my $elem = Person->new('Egon');
    ...
    
    # method chaining
    $cont->get_elem('Egon')->pay_rent();
    
  3. or download this
    $elem1 = $cont1->get_elem('Egon');
    $elem2 = $cont2->get_elem('Egon');
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-16 10:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found