in reply to Appending lines starting with white space to the previous line

Update: Sorry, I just realised, this is in essence what has been suggested by 1Nf3 right at the beginning of this thread ... apologies!

*********************************************************

Personally, I like the following two-liner because it is concise, simple and flexible (as illustrated, it will also work with an arbitrary number of indented lines):
( my $line = ( join "", <> ) ) =~ s/\n\s+//g; print $line; ______DATA_______ firstline54324563213612531436436463246324634 secondlidfndsfdsfdsfd thirdlinedsfsdf firstline54324563213612531436436463246324634 secondlidfndsfdsfdsfd thirdlinedsfsdf fourthlinedsfsdf fifthlinedsfsdf _____OUTPUT______ firstline54324563213612531436436463246324634secondlidfndsfdsfdsfdthird +linedsfsdf firstline54324563213612531436436463246324634secondlidfndsfdsfdsfdthird +linedsfsdffourthlinedsfsdffifthlinedsfsdf
Essentially, it compounds the entire data file into a single string from which any occurrence of \n\s+ is then removed. The latter string sequence is the one which occurs at every line end except for those line ends before a firstline.

Hope this helps.

Best regards -

Pat