Moose Moose - It's the new camel #8

Standard inheritance

package Employee;

use strict;
use warnings;

use Id;

use base 'Person';

sub new {
    my ($class) = @_;

    my $self = $class->SUPER::new();
    $self->{'title'} = '';
    $self->{'id'}    = Id::next();

    return $self;
}

sub id {
    my ($self, $id) = @_;
    return $self->{'id'}; 
}

sub title {
    my ($self, $title) = @_;
    $self->{'title'} = $title if $title;
    return $self->{'title'};
}

1;
Copyright © 2007 Robert Boone