There are two ways of passing data to a subroutine:Actually, there's also:- call by value
- call by reference
- 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
In reply to Re^2: passing arrays to subroutines
by QM
in thread passing arrays to subroutines
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |