# hash that counts appearance of a word my %wordcounter; # collected words foreach (@words){ if (length $_ >= 2){ chomp $_; # remove newline $_ =~ s/[!:.,?()#]//g; # remove possible symbols #print $_."\n"; # increase wordcounter $wordcounter{$_}++; }; } my $position; my @keywords; my $keyword; # print out words from wordcounter foreach $key (keys%wordcounter){ foreach(@blacklists){ # check if a word is blacklistet # if it is not, all positions that have been found in the file are recorded if ($_->validate($key)){ $keyword = HTML_Indexer::Word->new($key); # save all positions #for(1..$wordcounter{$key}){ # #print $key." : ".$wordcounter{$key}."\n"; # $position = new HTML_Indexer::Position($filename, $anchorid); # $keyword->addPosition($position); # } push @keywords, $keyword; print "Test: ".$keyword->getName()."\n"; } else { print $key." : BLACKLISTED \n"; } } } # Testoutput => Hier tritt der Fehler auf! foreach my $wd(@keywords){ print "Test: ".$wd->getName()."\n"; #output is alway @_ ??; }