Boilerplate Code 1
It's not uncommon to see a sight such as this in a majority of our database interacting subroutines:
return $self->_error('_enum failed') unless
my $Estatus = $self->_enum('corr','status');
return $self->_error('_enum failed') unless
my $Etype = $self->_enum('corr','type');
return $self->_error('_enum failed') unless
my $Eaction = $self->_enum('corr','action');
return $self->_error("type not found: $params{type}") unless $Etype->{$params{type}};
$fields{type_id} = ['d',$Etype->{$params{type}}];
... database code ...