my $datei1 = '/path/to/file1.txt'; my $datei2 = '/path/to/file2.txt'; my $output = '/path/to/file3.txt'; my @lines; tie my @lines_file1, 'Tie::File', $datei1 or die $!; tie my @lines_file2, 'Tie::File', $datei2 or die $!; die "ungleiche Länge" if scalar(@lines_file1) != scalar(@lines_file2); for (0..$#lines_file1 ){ push @lines, $lines_file1.' '.$lines_file2; } untie @lines_file1; untie @lines_file2; open my $out, '>', $output or die $!; print $out $_,"\n" for @lines; close $out or die $!;