I can repeat your issue with my Linux box (and get good behavior w/ AS 5.8.8 under Windows). Based upon what I see in my debugger, you are having a scoping issue. Essentially, every iteration of your while loop reinitializes $line as per your my statement. My guess is they modified the scoping behavior in 5.10.0, which fixes this particular issue. You can avoid the problem with:
while (defined($line = <DATA>) )
chomp $line; # line 7
if ($line =~ s/\\$//) # line 8
$line .= <DATA>;
redo unless eof(DATA);
print "LINE: '$line'\n";
4 4 \
4 4 \
Update:Regarding your comment
I would expect that the while loop wouldn't run if there was an undefined line - so I'm unclear on why the chomp is giving the uninitialized variable warning.
you should check out the documentation to see why the original developer used a redo
in place of a next
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
Outside of code tags, you may need to use entities for some characters:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||