Help for this page

Select Code to Download


  1. or download this
    # return a list consisting of correct division and service
    # as a function of $dcr_type and @row
    sub division_service {
    ...
            croak "Unknown \$dcr_type '$dcr_type'";
        }
    }
    
  2. or download this
    # return a list consisting of correct division and service
    # as a function of $dcr_type and @row
    sub division_service {
    ...
                (($row->[0] eq 'Headquarters' ? 'HQ' : $row->[2]), undef) 
    +:
            croak "Unknown \$dcr_type '$dcr_type'";
    }
    
  3. or download this
    # return a list consisting of correct division and service
    # as a function of $dcr_type and @row
    sub division_service {
    ...
    
        return &{$map{$dcr_type} || croak "Unknown \$dcr_type '$dcr_type'"
    +}();
    }
    
  4. or download this
    BEGIN {
        my ($row, %map);
    
    ...
                sub { ($row->[0] eq 'Headquarters' ? 'HQ' : $row->[2]), un
    +def },
        );
    }