in reply to Re: passing arrays to asubroutine
in thread passing arrays to asubroutine

This is not for kids to try at home. :^) Not stuff for beginners. Prototypes are rather weird in Perl and usually best avoided.

They arcanely change context.

But it does get around the flattened parameter list issue.

#!/usr/bin/perl -w use strict; my @arr1 = qw/This is line 1/; my @arr2 = qw/The 2nd line/; sub print2arrays(\@@){ local $, = " "; my $a1 = shift; my @a2 = @_; print @$a1, "\n"; print @a2, "\n"; } print2arrays @arr1, @arr2;