use strict; use warnings; sub passingArray{ my $tmp = $_[0]; my $newtmp = $_[1]; print "Number of elements tmp: ". scalar( @$tmp ) . "\n"; print join( " ", @$tmp ) . "\n"; print "Number of elements newtmp: ". scalar( @$newtmp) . "\n"; print join( " ", @$newtmp) . "\n"; } #end of sub my @data = ( 22, 33, 44 ); my @newdata = ( 55, 66, 77 ); passingArray( \@data, \@newdata );