#!/usr/bin/perl -w use strict; undef $/; my $text = ; $text =~ s/([^."])\n/$1 /g; print "$text"; __DATA__ this is a wrapped line. "This is a wrapped quote." this first line is fine. so is this one. #### this is a wrapped line. "This is a wrapped quote." this first line is fine. so is this one.