Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Modular Code

by tinman (Curate)
on Jun 14, 2001 at 22:37 UTC ( [id://88564]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    The procedural method:
    $balance = add_to_acct($balance, $amount);
    ...
    The OOP method:
    my $acct_obj = new BankAccount($initial_balance);
    $acct_obj->add_to_acct($amount);
    
  2. or download this
    add_value($x);
    add_value($y);
    add_value($z);
    my @all_values = get_all_values;
    
  3. or download this
    @all_values = add_value($x, @all_values); 
    # gives the list to add to, and takes the newly added list # as a retu
    +rn value
    @all_values = add_value($y, @all_values); 
    ...
    # Now anytime you inspect @all_values, it has the currently # added el
    +ements.
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-03-29 10:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found