my @array = qw(wort1 wort2 .... wortn); my $re = join ("|", @array); my %statistics = (); foreach ( $string =~ m/($re)/g ) { $statistics{$_}++; }