foreach(@stopwords){ $is_stopwords{$_} = 1; } close(OPENSTOPW); open(OPENMY,'minipar.txt'); while(){ ... my($firstWord,$relation, $secondWord)=split(/:/,$_); my($first,$firstPOS)=split(/\s/,$firstWord); my($secondPOS,$second)=split(/\t/,$secondWord); ... if($is_stopwords{$second}){ next; } my $entry = "$relation $firstPOS $second $secondPOS"; $dependentWord{$entry}++; } close(OPENMY); print %is_stopwords, "\n";