#! perl use strict; use warnings; my $file = ''; while () { s{\\\n}{}; $file .= $_; } print $file; __DATA__ first line second line \ third line \ fourth line fifth line