Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: passing arrays to subroutines

by QM (Vicar)
on Mar 16, 2005 at 14:36 UTC ( #439954=note: print w/ replies, xml ) Need Help??


in reply to Re: passing arrays to subroutines
in thread passing arrays to subroutines

There are two ways of passing data to a subroutine:

- call by value
- call by reference

Actually, there's also:

- call by name
- call by copy-restore
- call by result
- call by push value
- call by need
- call by macro expansion

See Parameter (Computer Science) on Wikipedia.

Most (all?) of these can be done in Perl. In Perl, it really comes down to two things:

1) Parameters are passed as a list of scalars.
2) The caller and the callee have to agree on what those scalars mean.

-QM
--
Quantum Mechanics: The dreams stuff is made of


Comment on Re^2: passing arrays to subroutines

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (12)
As of 2015-07-29 20:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (267 votes), past polls