use strict; use warnings; my $file = \do{my $disk_file = "Inventorier\n" ."Trade receivables\n" ."Assets\n" ."This item includes impairment losses.\n" ; }; open (IN,'<:encoding(UTF-8)', $file) or die "Could not open '$file'$!"; *OUT = *stdout; while (my $text = ) { #$text =~ s/^[a-z].*[a-z]$//gmi; $text =~ s/^[a-z].*[a-z]\n$//i; print OUT $text; } close (IN) or die "Could not close input file: '$file' $!";