##
my $singleton;
sub new {
my($proto, $fields) = @_;
my($class) = ref $proto || $proto;
if ( ! defined $singleton ) {
$fields = {} unless defined $fields;
# make a copy of $fields.
$singleton = bless {%$fields}, $class;
}
return $singleton;
}
####
my $c1 = C->new( foo => 'bar' );
my $c2 = C->new( foo => 12345 );