in reply to constructing dynamic class definitions at compile time (from schema definition)

The problem of dynamic packages can be solved by a string eval()
my $pkg = "Foo"; eval qq{ package $pkg; sub new { bless [], shift } }; print ref $pkg->new; __output__ Foo
However this is a pretty nasty approach (I'm using string eval() for the love of ...). But if you're just attaching methods and attribs to a package in a fairly starightforward fashion you don't even need the package declaration
my $pkg = "Foo"; { no strict 'refs'; *{"${pkg}::new"} = sub { bless [], shift }; } print ref $pkg->new; __output__ Foo
Now you can have your dynamically created package just by fully qualifying the likes of subroutines and variables. So while it's possible to do what you want (this is Perl afterall) the question begs to be asked: why would you want to?
HTH

_________
broquaint