in reply to Seeing Perl in a new light
From what you describe, and how you seem to be thinking about your site structure, you might want to check out HTML::Mason.
Take a look at the homepage, and also there is a book available for free online (and in dead tree format too).
I know Mason adds a whole extra set of concepts to wrap your head around, but it will give you some powerful tools to achieve what you are looking for. The docs are pretty good, and as I said, it seems like a good conceptual fit.