in reply to Help with Metaclasses

You should also read Guido van Rossum's paper for the nuts and bolts of Python metaclasses. For a real world usage of metaclasses, look at SQLObject - an object-relational mapping tool for Python.

As others have pointed out, Perl does not currently have an equivalent construct; for something like that you will have to wait for Perl 6.