use strict; use Text::ParseWords; undef $/; my $infile = (<>); my @fields = &parse_line("\n", 1, $infile); foreach (@fields) { s/\n/ /; print "$_\n"; } #### John said \Hello\""