in reply to How do I dynamically declare a package name for

From yesterday, you might look at Re: Re: Re: OO design question. The only difference is that you might want to wrap the require (such as eval{ require $class }; like some have shown here).

Also, be sure to benchmark the difference between
eval{ $t = 1; }
and
eval "$t = 1;"
Your getting a very big server hit if you try to dynamically write perl syntax. If you don't need to create syntax on the fly, put braces around it. It will do much better and you can still catch bugs at compile time.

my @a=qw(random brilliant braindead); print $a[rand(@a)];