in reply to Next from inner loop only works "most of the time"
Still puzzled.
We seem to agree that the given code is bad style, but should work.
If it doesn't, the problem might be hidden in another piece of code you thought to be irrelevant.
From your "run" output it is not clear to me, if there is some kind of user interaction involved in your loops.
This could change the game because
while (<$fh>) { ... }
would modify a non-localized $_.
Just a wild guess, but I ran into this trap some time ago...
Greetings,
-jo
|
|---|