sub param { my $self=shift; my $name=shift; if(@_) { my $val=shift; my $method="set_$name"; #croak("use method $method()") if($self->can($method)); $self->$method($val) if($self->can($method)); return 0 unless(exists($self->{$name})); $self->{$name}=$val; return 1; } my $method="get_$name"; #croak("use method $method()") if($self->can($method)); $self->$method() if($self->can($method)); return undef unless(exists($self->{$name})); return $self->{$name}; }