10 my %_attr_data = ( # DEFAULT
15 my ($self, $attr) = @_;
26 my ($caller, %args) = @_;
27 my $caller_is_obj = ref($caller);
28 my $class = $caller_is_obj || $caller;
29 my $self = bless {}, $class;
30 foreach my $attrname ($self->_standard_keys()) {
31 my ($argname) = ($attrname =~ /^_(.*)/);
32 if (exists $args{$argname}) {
33 #printf STDERR "Setting up $attrname\n";
34 $self->{$attrname} = $args{$argname};
35 } elsif ($caller_is_obj) {
36 #printf STDERR "Copying $attrname\n";
37 $self->{$attrname} = $caller->{$argname};
39 #printf STDERR "Using default for $attrname\n";
40 $self->{$attrname} = $self->_default_for($argname);