We are checking to see the rental fee for an item, but assume that a rule was found 101 my $units = $issuing_rule->lengthunit; 102 my $rentalcharge_increment = ( $units eq 'days' ) ? $itemtype->rentalcharge_daily : $itemtype->rentalcharge_hourly; we should set the unit to 'days' if no rule found or simply return 0 (no charge if you aren't allowed to issue)