|The stupid question is the question not asked|
Re: header footerby kcott (Bishop)
|on Mar 04, 2014 at 22:13 UTC||Need Help??|
Welcome to the monastery.
Your substitution regex has little bearing on the task you describe. You might want to get up to speed on Perl's regular expresions by reading "perlrequick - Perl regular expressions quick start" and "perlretut - Perl regular expressions tutorial".
Having said that, I see no reason to use regular expressions here: substr is quite capable of doing this (and I'd expect it to be a lot faster).
Here's an example script, pm_1076973.pl, with much short header and footer lengths for demo purposes:
Here's the starting files (before that script is run):
Now run the script:
Now the files look like this: