sub read_data { my @curr = (); # aktueller Datensatz my %hash = (); while (<>) { # bricht bei EOF ab chomp; $count++; if ($_ ne '---'){ @curr = split(/\|/); $error=$curr[1]; $hash{$error} = $count; #$error=$curr[1]; } else {last;} } print %hash; print "\n"; return %hash; }