my $line = ''; while (<$in>) { $line .= $_; next if m/\\$/; chomp $line; my @cols = (''); my @tabs = split /\t/, $line; foreach (@tabs) { $cols[$#cols] =~ m/\\$/ and do { $cols[$#cols] .= "\t$_"; next; }; push @cols, $_; } shift @cols; $line = ''; }