in reply to Multiple Prototypes for Object Constructor
And hopefully that should do the right thing for your given case.{ ## accepted attributes my %options = map { $_ => undef } qw/ from_node to_node label /; sub new { my $class = shift; bless { %options, map { exists $options{$_} ? ( $_ => 1 ) : () } @_ }, $class } }
_________
broquaint
update: code complies with OP request
|
|---|