Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: composite pattern, best practice, pushing into an array in a hash, reusing the get array method

by vladb (Vicar)
on Feb 13, 2006 at 21:23 UTC ( [id://529936]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # private getCreditAccounts
    sub getCreditAccounts {
    ...
    # working on a copy of the original array...
    my @anotherArray = $obj->getCreditAccounts();
    push @anotherArray, "Data";
    
  2. or download this
    # private getCreditAccounts
    # now returning reference to the original array
    ...
        my $account = shift;
        push @{ $closure->getCreditAccounts() }, $account;
    }
    

Log In?
Username:
Password:

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

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

    No recent polls found