in reply to next statement logic
Also, your description is confusing, as you mention %hash3, but %hash3 never shows up in the code.
This is how I would change your script, given my understanding of your problem.
while ($line = <MAIN_FILE1>){ chomp $line; if (exists $hash2{$entry}) { print OUTPUT2 "$filename\n"; next; } # either exists in %hash1, # or not in either, # so output to OUTPUT1 print OUTPUT1 "$filename\n"; next; } close(MAIN_FILE1)
-QM
--
Quantum Mechanics: The dreams stuff is made of
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: next statement logic
by Anonymous Monk on Feb 20, 2006 at 18:16 UTC | |
by QM (Parson) on Feb 20, 2006 at 19:25 UTC | |
by Not_a_Number (Prior) on Feb 20, 2006 at 20:13 UTC |