### use this instead of the 'use enum' statement: my %index = ( sec => 0, min => 1, hour => 2, mday => 3, mon => 4, year => 5, wday => 6, yday => 7, ); ### Replace get() with this. All remaining code is identical. sub get { my ($self, $field) = @_; return $self->[$index{$field}]; }