# return a list consisting of correct division and service # as a function of $dcr_type and @row sub division_service { my ($dcr_type, @row) = ( uc $_[0], @{$_[1]} ); return ('HQ' , undef) if $dcr_type eq 'CONTACT' ; if ($dcr_type eq 'FAQ') { return (undef, $row[2] eq 'Service' ? $row[3] : $row[4]); } return (undef, $row[4]) if ($dcr_type eq 'LITERATURE') ; if ($dcr_type eq 'ORGANIZATION') { my @ret = ($row[2], undef); $ret[0] = 'HQ' if ($row[0] eq 'Headquarters'); return @ret; } }