- or download this
use base Vehicle;
@ISA = 'Vehicle';
- or download this
my %valid = map { $_ => 1 } qw( Wheels Doors Color Passengers );
my %ro = map { $_ => 1 } qw( Wheels );
...
my ($self, $option) = @_;
return defined $ro{$option} ? 1 : 0;
}
- or download this
sub _attributes
{
return
...
my ($self, $attribute) = @_;
return exists $self->_attributes()->{ $attribute };
}