$anfrage = "SELECT * FROM artikel"; &datenbank; $ergebnisse = $sth->fetchall_arrayref( {beschr1 => 1, id => 1} ); foreach(@$ergebnisse) { $beschr1 = $_->{beschr1}; $id = $_->{id}; ## Wörter in Array schreiben, zählen und nach Vorkommen sortieren push @liste, split /[^a-zA-ZäöüÄÖÜß-]/, $beschr1; foreach $wort (@liste) { $wortliste{$wort}++; } foreach $wort (sort keys %wortliste) { push (@neue_liste,"$wortliste{$wort}||$wort"); } my @sortierte_liste = sort { $b <=> $a } @neue_liste; print "
".@sortierte_liste; }