if you want to pass array, use pass by reference.
passingArray( \@data, \@newdata );
sub passingArray {
my ( $aref1, $aref2 ) = @_;
print "Number of elements tmp: $#$aref1\n";
print "tmp1 @tmp\n";
print "Number of elements newtmp: $#$aref2\n";
print "tmp1 @$aref2\n";
}