my $pkg = "Foo"; { no strict 'refs'; *{"${pkg}::new"} = sub { bless [], shift }; } print ref $pkg->new; __output__ Foo