in reply to Help creating a function
generally you can do something like this:
but, it will not work for any package. Also instead of bless you can call a constructor:use Module::Load; sub get_object { my ($class, $href) = @_; load $class; return bless $href, $class; }
but again, it won't work for any package.return $class->new($href);
|
|---|