#!/usr/bin/perl -w use strict; $/ = ''; while () { next unless /\S/; chomp; s{\\\n}{}g; print "Line: ", $_,"\n"; } __DATA__ this is a good \ nice day but not a good nice \ night This is a test line This is a another test \ Line This is \ a final test line #### Line: this is a good nice day but not a good nice night Line: This is a test line Line: This is a another test Line Line: This is \ a final test line