in reply to Re: reading/writing to a file
in thread reading/writing to a file

Just to make it clear that I know this:
A premature optimisation is a Bad Thing
Now, I'd like to oberve that you don't really need two separate hashes, but only the dictionary (or the exclude, if you prefer) one. Basically, words that were already seen (either because already present in the output file, or because you see them as you iterate over the INPUT ONE) are to be excluded, so you can mix the two sets. The consequence is two-fold:

Update: corrected the auto-vivification beasty comment. I wonder how much wrong assumptions I've got inside my head - at least the magnitude order.

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.

Replies are listed 'Best First'.
Re^3: reading/writing to a file
by tlm (Prior) on Jun 18, 2005 at 20:49 UTC

    I don't follow you on the autovivification point. No keys in %$exclude are autovivified in the code I posted.

    The decision to use two hashes was one of several that I made for the sake of clarity alone, since I thought that in that way it would be easier for the OP to adapt it to his/her needs. (I.e., I agree with the quote at the beginning of your post :) )

    the lowliest monk