sub merge_lines { my ($lines1, $lines2) = @_; my @lines; .... return \@lines; }