- # fgrep is seriously faster than using perl
- open DESC, '-|', 'fgrep', '-n', '--', $first_keyword, $file
- or die "couldn't open $file: $!";
- LINE:
- while (<DESC>) {
- foreach my $k (@$keywords) {
- next LINE unless /\Q$k\E/;
- }
- /^(\d+)/;
- my $nr = $1;
- debug( "Matched line $_", 2) if DEBUG;
- my $result = $did2pkg->{$nr};
+ foreach my $match ( @matches ) {
+ my $id = $match->get_docid();
+ my $result = $did2pkg->{$id};
+