"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Hi,
Best way is to pass a reference to the array, then dereference it in the subroutine. Like this:
Update: Just read Prasad's post. You can just pass the raw array to the subroutine, in which case @_ in the sub is the content of the array. I prefer to use a reference to make it very explicit that this is a single variable - not a sequence of parameters. Neither method is more correct than the other, although Prasads is simpler.
g0n, backpropagated monk
In reply to Re: passing arrays to subroutines
by g0n
|
|