in reply to replacing code with regex

Is there a particular reason you don't just write the create_page and isitvalid subroutines that do all the OO stuff and then eval() the textfile?

Seems a lot more robust than this solution - well, except if you can't trust the input, ofcourse.

update: never mind, I misread your question.