Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: testing parts of a string against a word database

by Eliya (Vicar)
on Dec 01, 2011 at 00:16 UTC ( #940973=note: print w/replies, xml ) Need Help??

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!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://940973]
[TStanley]: I'm sitting in the airport in Tampa, Florida at the moment, getting ready to head home.
[talexb]: TStanley I'm flying to Vegas in two weeks time. After that flights leaving Vegas and Phoenix are late at night .. I've been hearing that it gets so hot that the air isn't dense enough for planes to take off. Weird. Guess you won't have that problem.

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2017-06-23 14:13 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (548 votes). Check out past polls.