in reply to Reading "slices" out of a file at known start markers

I'm appalled at everyone who answered. You're not the first to have wanted to do this. Makefile::Parser is on CPAN. If it doesn't do everything you need, it at least has the beginnings and (presumably) a test suite so that you can extend it.

My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?