my $doc = '...'; $doc =~ s/.../.../g; ...; print ">>$doc<< \n";