# in base class: our $TIMEOUT_ERROR; Readonly $TIMEOUT_ERROR => 10; # I also tried this instead: # Readonly our $TIMEOUT_ERROR => 10; # then in the sub class: if ($nothing_happens) { $self->errorcode( $TIMEOUT_ERROR ); }