in reply to regex large named.conf parsing

Forgive me if I'm wrong, but it sounds like you're attempting to manage your named.conf. Here's a thought - instead of managing it within itself, instead, manage it from a database and have a script that will generate it from the database. Think of it as source and a makefile to create your executable - you won't ever touch the actual named.conf.

As to your problem - there's an easy way to find out where the bottleneck is: add timing statements.

print "Time: ", join(':', map { sprintf("%02d", $_) } (localtime(time) +)[2,1,0]), $/;
Put that line before and after every area you want to time and you'll get a rough idea, in seconds, of what's happening. It won't help you really with real optimization, but it sounds like you just want to know if it's the first half or the second half that's causing your issues.

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.