Are Perl subroutines call-by-reference or call-by-value?
Perl always passes by reference. It’s just that sometimes the caller passes temporary scalars. The first thing you have to realise is that the arguments of subs can be one and only one thing: a list of scalars.* One cannot pass arrays or hashes to them. Arrays and hashes are evaluated, returning a list of … Read more