#!/usr/bin/perl -w use strict; my $comments = do { local $/; }; print "BEFORE:\n$comments"; $comments =~ s///g; print "AFTER:\n$comments"; __DATA__ snippet of code