in reply to Re: Reading in a text file with "multi line lines"
in thread Reading in a text file with "multi line lines"

Close, but the output doesn't join the lines, as OP asked. I think a big part of the problem is rooted in the thought-process behind your first comment, "current line ends with \," which, strictly speaking, is not the case. The lines in question actually end with a "\" and a newline.

This helps (but does NOT solve; caveats below) if added after your second while :

while (s/\n/ /s) { # remove the newlines my $out = $_; print $out; }

Tested, more-or-less using GrandFather's "framework" (below). And just BTW or nitpicking, your (Skeeve's) comment "append a new line" would perhaps be clearer or less ambiguous if written as "append the next line from DATA.

The problem (yep, this is the caveat) is that with multiple sets of data (which I infer from the OP's 'ignoring all the lines which are blank or contain just "space".') this still doesn't separate the sets, as does jmcnamara's, below, qv (and ++).