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
In reply to Re: Storing references to constructors with context
by Jenda
in thread Storing references to constructors with context
by pernod
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |