in reply to passing an array
That will get the data in.sub doStuff { my($arg1, $arg2, $arg3, $ar4, @data) = @_; ..... # other stuff here }
Meanwhile this should get the the array.
Now if your array were huge (not the two element array mentioned here)
then passing by reference might be the way to go.
But I figure if you're scaling the challenge of just getting data in, there's no point throwing variables by reference at you just yet.
But do bookmark the thought it can be useful.
HTH
Claude
p.s.
will not work. The @data will suck up all the vars leaving nothing in $arg5. Just a warning from someone who didn't know this at 3 a.m.my($arg1, $arg2, $arg3, $ar4, @data, $arg5) = @_;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: passing an array
by rbi (Monk) on Mar 28, 2001 at 16:25 UTC |