in reply to Crossword helper

I notice that you read all the words into memory, even though you only want words of a single length. You can save memory by filtering out the other words as you read:
while (<INP>) { chomp; push @chk if length == $word_length; }
On the other hand, you might like to make this an interactive script, which reads in all the words, and then prompts for commands from standard input in a loop.

Replies are listed 'Best First'.
Re: Re: Crossword helper
by zzspectrez (Hermit) on Jan 31, 2001 at 06:01 UTC

    When I first wrote this, user input was read from STDIN within a loop. This way you could check multiple words, etc... That necesitated keeping it all in memory. Then I made it command line.

    But as you have pointed out... I didnt clean it up for processing it this way. I should modify as you suggest....

    THANKS!!
    zzSPECTREz