in reply to Question on parsing a text file.
If you want to 1)combine the multiple lines in advance, you could slurp the file with $/, use a regular expression to strip "\\\n" and then split on the remaining new lines.
If you want to 2)join on the fly while reading the files in line by line, you could use add buffer to your while loop and use next to do flow control if the line ends with backslash, like:
my $buffer = q{}; while(<F>) { $buffer .= $_; if (multiple line) { next; } else { #process; $buffer = q{}; } }
|
|---|