in reply to Comment not matching code in Programming Perl

I think given the context of the example in the Camel that the behavior is correct. I do think it is a poor example for someone that is new to Perl.
Prior to the example it is stated that suppose we had a file that had \ at the end of a line to indicate that is continued on the next line. This is common in shell scripts. Your examples are assuming that the lines do not have a space before the \ character, again this is not typical in shell scripts. So perhaps a good example of a file would be:
find ./ --name igloo.txt | \ xargs ls -l $1 | \ grep 'Dec'
Now that is a pointless shell script, but it illustrates the use of the \ at the end of a line that I think might be what the example in the book is refering to.
A more readable example would be:
Hello Cold Cruel \ World. Are you ready to take a trip to \ the mall with me for some very delicious ice cream? I think this will make for a delightful day, \ don't you?
it would "do the right thing", which is get the next line of the file and append it to the previous lines before it enters the # now process $_ block if the pattern match is a success.

So the eof is needed to prevent it from reading past it, since in effect the redo conditional is superseding the while statement. That is if I am understanding the redo function correctly.

Revised example:
while (<DATA>) { chomp; if (s/\\//) { $_ .= <DATA>; redo unless eof; # don't read past each file's eof } # now proces $_ print $_ . "\n"; } __DATA__ Hello Cold Cruel \ World. Are you ready to take a trip to \ the mall with me for some very delicious ice cream? I think this will make for a delightful day, \ don't you?