in reply to Counting occurence of a list of word in a file
while my $text=<$testo>){ ... $count += () = /\b$key\b/ig while <>; }
The <> file handle is exhausted in the first run of the outer while loop, thus certainly not doing what you want. Why do you read from <> at all? Doesn't $text already contain an input line?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Counting occurence of a list of word in a file
by b_vulnerability (Novice) on Nov 11, 2008 at 16:49 UTC | |
|
Re^2: Counting occurence of a list of word in a file
by b_vulnerability (Novice) on Nov 11, 2008 at 16:53 UTC | |
by moritz (Cardinal) on Nov 11, 2008 at 16:54 UTC |