#!/usr/local/bin/perl -w use strict; use warnings; my $miniparDir = "home/sat/minipar"; my @dataArray; my $parsedMiniparOutput; my %dependentWord; my %is_stopwords; my $searchWord = $ARGV[0]; open(my $fh_stop,'<','stopwords.lst') or die $!; while(my $line = <$fh_stop>){ chomp $line; $is_stopwords{$line} = 1; } close $fh_stop; open(my $fh,'<','minipar.txt') or die $!; while(my $line = <$fh>){ ... my($firstWord,$relation, $secondWord)=split(/:/,$line); 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($fh); print %is_stopwords, "\n";