in reply to Re^2: next statement logic
in thread next statement logic
1) Everything is printed to OUTPUT1, including anything that matches in either %hash1 or %hash2.
2) Anything found in %hash2 should also be printed to OUTPUT2.
If I have that correct, then my example should be changed to the following:
Note that no next statement is needed, regardless of the order of print/if.while ($line = <MAIN_FILE1>){ chomp $line; print OUTPUT1 "$filename\n"; if (exists $hash2{$entry}) { print OUTPUT2 "$filename\n"; } } close(MAIN_FILE1)
-QM
--
Quantum Mechanics: The dreams stuff is made of
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: next statement logic
by Not_a_Number (Prior) on Feb 20, 2006 at 20:13 UTC |