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.
By the time you
undef $/, the first line has already been read. Use the-0option to set$/before anything has been read.