for(0..(scalar @files)-1){ open my $fh,'<',$files[$_] or die $!; while(do {local $/="\n\n\n";defined($data = <"$fh">)}){ for my $line(split(/\r?\n/,$data)){ chomp $line; my $spalte1 = (split(/\s+/,$line))[0]; my $spalte2 = (split(/\s+/,$line))[1]; my $spalte3 = (split(/\s+/,$line))[2]; $hash{$_} = ($spalte1, $spalte2, $spalte3); } } }