in reply to Now you see it, now you don't

Or you can use AUTOLOAD. I use it in my base classes, then setup the inherited object's attributes in the object initialization (which AUTOLOAD will check to see if they exist before granting access to them).

### our magic accessor generator sub AUTOLOAD { my $self = shift; my $auto = (split(/\:\:/,$AUTOLOAD))[-1]; $auto = $AUTOLOAD unless $auto; return if $auto eq 'DESTROY'; ### ignore die "No such method: $auto\n" unless (exists $self->{$auto}); if ( @_ ){ my @args = @_; if( scalar(@args) > 1){ $self->{$auto} = \@args; }else{ $self->{$auto} = $args[0]; } }else{ return $self->{$auto}; } }

cp
----
"Never be afraid to try something new. Remember, amateurs built the ark. Professionals built the Titanic."