... my %textinhalte; open my $fh, '<', $FILE or die "cannot open $FILE: $!"; while (<$fh>) { $textinhalte{$1}++ if m~(.*)~; } close $fh; print "Anzahl unterschiedlicher Inhalte: ", scalar keys %textinhalte;