my $pkg = "Foo"; eval qq{ package $pkg; sub new { bless [], shift } }; print ref $pkg->new; __output__ Foo