#!/usr/bin/perl -w use strict; while () { if (m|^\s*\| ... m|^\s*\<\/Content\>|) { s/(\^M)+/\^M/g; #compress multiple ^M to one s/(\^M)/<br\/>>/g; print $_ unless m|\<.?Content\>|; # don't print # or <\Content> lines } } =pod THE ABOVE CODE PRINTS: Some of the week's top stories:<br/>> EASTON AREA<br/>> BETHLEHEM AREA<br/>> CARBON, SCHUYLKILL AND REGION<br/>> have charged his mother's boyfriend, Paul Hoffman, with third-degree murder. Officials said the charges were filed after an exhaustive investigation that showed Miller, who died Sept. 25, had the mental capacity of a 12-year-old.<br/>> =cut __DATA__ ^M 124^M^M Some of the week's top stories:^M EASTON AREA^M BETHLEHEM AREA^M CARBON, SCHUYLKILL AND REGION^M^M have charged his mother's boyfriend, Paul Hoffman, with third-degree murder. Officials said the charges were filed after an exhaustive investigation that showed Miller, who died Sept. 25, had the mental capacity of a 12-year-old.^M ^M ^M ^M ^M ^M ^M