Shaun Bramley wrote:
> 
> Hello all,

Hello,

> I currently currently passing a subroutine one scalar value and two arrays.
> Both array's work before and after the function call.  However only one of
> hte arrays works within the subroutine.
> 
> example code:
> 
> print @array1;  //this works
> print @array2;  //this works
> subroutine($a, @array1, @array2);
> 
> sub subroutine($a, @array1, @array2)
> {
> print @array1; //this works
> print @array2;  //this does not work
> }
> 
> It is always the same array that is not being passed.  Even if I switch
> @array1 and @array2 I still will only get one useable array within the
> subroutine.


You should read the documentation on Perl subroutines:

perldoc perlsub

Where you will find that perl flattens all subroutine arguments to a
single list.  The documentation will also explain how to pass multiple
arrays and hashes to a subroutine.



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to