Actually, it's not quit that simple. Perl's standard calling convention isn't pass by value. The values that you get in @_ are aliases to the original variables, so changing @_ will change the values outside the subroutine, as this simple test demonstrates.
--my $x = 1; mult($x); print "$x\n"; sub mult { $_[0] *= 10; }
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
In reply to RE: Re: passing refs to subs
by davorg
in thread passing refs to subs
by jptxs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |