in reply to Search Engine Output needs sorting
for (my $j=0; $j <= @grammatches; $j++) { ## Could be normal $j++ if u +se another variable instead of @matches for both ... for (my $l=0; $l <= @headmatches; $l++) { ... for (my $m=0; $m <= @sentmatches; $m++) {
You have an off-by-one error on your for loops, you are trying to access one element past the end the arrays. Those are usually written as:
for my $j ( 0 .. $#grammatches ) { ## Could be normal $j++ if use anot +her variable instead of @matches for both ... for my $l ( 0 .. $#headmatches ) { ... for my $m ( 0 .. $#sentmatches ) {
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Search Engine Output needs sorting
by Anonymous Monk on May 28, 2011 at 13:04 UTC | |
by johngg (Canon) on May 28, 2011 at 13:17 UTC | |
by Anonymous Monk on May 28, 2011 at 14:04 UTC | |
by Anonymous Monk on May 28, 2011 at 14:12 UTC | |
by johngg (Canon) on May 28, 2011 at 14:44 UTC | |
|
Re^2: Search Engine Output needs sorting
by Anonymous Monk on May 28, 2011 at 18:09 UTC | |
by MidLifeXis (Monsignor) on May 31, 2011 at 13:28 UTC |