If you are right, that means that the scoping rules would be different between Windows and Linux? Seems strange to me.
But I see the same output (but not the warnings!) as the OP if I replace the redo with next and that is as expected.
The difference between redo and next being that redo does not re-evaluate the condition, whereas next of course does. In other words, with redo you do not run the defined(my $line = <DATA>) again, so the accumulation of the "broken" lines work and hence it cannot be a scoping issue since you never leave, nor re-enter the scope.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
In reply to Re^2: Reading a text file collapsing line continuations
by CountZero
in thread Reading a text file collapsing line continuations
by skx
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |