I'm trying to strip some content from an HTML file automatically, and I'm using the following command to strip everything up to the useful data:
perl -pi.bak -e 'undef $/; s/^.*?<pre>//s' $file
However, for some reason this leaves the first line of the HTML file (the DOCTYPE declaration) alone.