in reply to Re^2: How to declare arrays and scalars together?
in thread How to declare arrays and scalars together?

You're passing array references there, not arrays.

  • Comment on Re^3: How to declare arrays and scalars together?

Replies are listed 'Best First'.
Re^4: How to declare arrays and scalars together?
by 2teez (Vicar) on Jun 18, 2012 at 19:32 UTC

    That is my point. It is possible to pass multiple arrays, using array reference.

      That is my point. It is possible to pass multiple arrays, using array reference

      Well, you missed the point of Re: How to declare arrays and scalars together? which is, you're only passing lists, you cannot pass an array, an array and an arrayref aren't identical, you need to de-reference an arrayref, but not an array

      Given my @one = (1,1); my @two = (2,2);

      This  foo( @one, @two ); is basically the same as  foo( 1,1,2,2 );

      With the appropriate prototype  foo( @one, @two ); could also be basically the same as  foo( \@one, \@two );

      If you use  foo( \@one, \@two ); then in sub foo you would need to write     my( $oneref, $tworef ) = @_; which is not the same as  my( @one, @two ) = @_;

      You're always passing lists to subroutines