http://www.perlmonks.org?node_id=940973


in reply to testing parts of a string against a word database

The problem is that you're trying to iterate through the filehandle NOUNS multiple times without reopening or resetting the file pointer to the beginning of the file.

So either use seek, or change the nesting of the loops so that you just have to go through the file once, i.e.

while (<NOUNS>) { foreach my $element (@senElements) { ... } }

Replies are listed 'Best First'.
Re^2: testing parts of a string against a word database
by Rudolf (Pilgrim) on Dec 01, 2011 at 00:21 UTC
    Ah, a rookie mistake it seems. Thank you for your time Eliya!