sub array_merge{ my(@array1, @array2) = @_; foreach my $element (@array2){ @array1 = (@array1, $element); }#foreach return @array1; }#array_merge