Sorry I already wanted to nitpick when GotToBTru mentioned this terminology. :)
Technically all calls in Perl are call-by-reference , cause @_ holds so called aliases (implicitly)
But copying from @_ makes most Perl routines de facto act like call-by-value .
So what the OP does is a simulated call by value where the value is an explicit reference.
I feel the need to clarify this cause the terminology is older than Perl and meant to describe languages without explicit ref type. ;)
These concepts are meant to describe differences between languages not Perl features.
For instance JS has a mix of both:
- simple types ("scalars") are always passed by value
- objects (including arrays and "hashes") always as references.
edit
Should be noted that JS doesn't have an explicit ref operator.
Concepts in "quotes" only translate roughly and would need deeper explanation.
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
|