Go to Catalyst! Especially if you have a good test suite already. This is there for you, Catalyst::View::Text::Template (Catalyst is completely agnostic about the pieces it can use and mix and match), and the amount of extras that are there to help are huge.
It's a pretty steep learning curve at first but it will pay handsomely soon after.
Strangely enough, I had a CGI that was about 7,000 lines in 2006 which I replaced with a Catalyst app in 3 days; this was after I was pretty handy with the kit already. This was a particularly simple app (just had a lot of parts) so YMMV but Catalyst
made web development quite rapid once you get the hang of it.