sub new { my ($classname, $file) = @_; open( my $FH, '<:unix:encoding(UTF-8)', $file) or return "Dateilesefehler: '$file' konnte von Trk_dict nicht geöffnet werden\nGrund: $!\n"; chomp(my @inhalt = <$FH>); close $FH; # Prüfen ob Dateiinhalt Hash tauglich ist if (($#inhalt+1) % 2 and $inhalt[$#inhalt] eq "\n"){pop @inhalt} if (($#inhalt+1) % 2){return "Dateiinhalt inkonsistent\n"} push @inhalt, "_file", $file; # wird benötigt zum automatischen Speichern my %dict = @inhalt; my $self = \%dict; bless($self, $classname); }