# Change default separator to \n" $/ = "\n\""; while () { # Put " in the beginning of line. $_ = qq/"$_/ unless m/^"/; # Removes \n s/\n/ /g; }