Help for this page

Select Code to Download


  1. or download this
    use base Vehicle;
    @ISA = 'Vehicle';
    
  2. 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;
    }
    
  3. or download this
    sub _attributes
    {
        return
    ...
        my ($self, $attribute) = @_;
        return exists $self->_attributes()->{ $attribute };
    }