in reply to Storing references to constructors with context

You want this:

my %constructors = ( "one" => sub {One->new(@_)}, "two" => sub {Two->new(@_)} );

Jenda
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
   -- Rick Osborne

Edit by castaway: Closed small tag in signature