#!/usr/bin/perl use strict; use warnings; my @files = qw(bla1.txt bla2.txt bla3.txt bla4.txt); my $output = 'blagesamt.txt'; open(my $write_fh, '>', $output) or die $!; for my $file(@files){   open(my $fh,'<',$file) or die $!;   while(my $line = <$fh>){    my $no_break_space = chr(0xa0);       $write_fh $line.= $no_break_space/_/g;        print $write_fh $line;        $write_fh $line =~ s/$no_break_space/_/g;            print $write_fh $line        }   close $fh;   } close $write_fh or die $!;