in reply to In-place header/footer

Here's how I would do it:

perl -pi.bak -0 -e 's/(.*)/prepend\n$1append\n/s' *.html

This works by using the -p switch to set up a loop around the contents of each file and the -0 switch to set the end of line terminator ($/) to null. Then you can peform a regex on the entire file as one big string.

Replies are listed 'Best First'.
Re(2): In-place header/footer
by swiftone (Curate) on Apr 01, 2002 at 16:57 UTC
    Works beautifully! Many thanks.

    (for the curious, so did RMGir's answer above)