While waiting to feel better, I got to work on Config::ApacheFormat 1.1. A coworker of mine had suggested a couple good ideas for new features. Also, I realized while spell-checking an email that I spelled "inheritance" wrong, both in the docs and in the API. So, I've deprecated my wrong spelling on the off-chance that someone dove on the code and started using it the day after it came out. I'll remove support in the next version and hopefully forget the shame of it all by this time next year.
Once those important issues were out of the way, I got down to my favorite part, optimization. First I removed the recursion from the get() method, which was satisfying. Then I got a hold of the largest Apache conf I could find and ran it through the parser. After some time with Devel::DProf I had the parser running in half the time.
The huge config had some constructs I didn't realize were possible, and I fixed my parser to handle them.
And to top it all off, I removed the need to load the entire file before parsing AND added support for tracking the filename and line number inside included files for use in error messages. The two were related because I'd taken the easy way out by using a single
@lines array and just doing an
unshift(@line, <$include_fh>) when I came across an include directive. Simple to code, but abusive of both time and memory.
A pretty good day, all things considered.