1package autoclass_010::Parent; 2use strict; 3use Class::AutoClass; 4use vars 5 qw(@ISA @AUTO_ATTRIBUTES @OTHER_ATTRIBUTES @CLASS_ATTRIBUTES %SYNONYMS %DEFAULTS); 6@ISA = qw(Class::AutoClass); 7@AUTO_ATTRIBUTES = qw(auto real auto_dflt real_dflt); 8@OTHER_ATTRIBUTES = qw(other other_dflt); 9@CLASS_ATTRIBUTES = qw(class class_dflt); 10%SYNONYMS = (syn=>'real',syn_dflt=>'real_dflt' ); 11%DEFAULTS = (auto_dflt => 'auto attribute default', 12 other_dflt=> 'other attribute default', 13 class_dflt => 'class attribute default', 14 real_dflt => 'real default', 15 syn_dflt => 'synonym default', 16 ); 17Class::AutoClass::declare; 18 19sub other { 20 my $self=shift; 21 push(@{$self->{_other}},@_) if @_; # need 'if' to prevent auto-vivification on 'get' 22 $self->{_other}; 23} 24sub other_dflt { 25 my $self=shift; 26 push(@{$self->{_other_dflt}},@_) if @_; # need 'if' to prevent auto-vivification on 'get' 27 $self->{_other_dflt}; 28} 291; 30