I just went a little simpler. You could make Priorirty numeric is you want. Just change the values assigned to it. I assigned a default value of 005 just in case someone ticked me off in which case they got '000'
Priority => [17, 'alpha', 3, 3, 0, '005', ''],
-------------------------------------------------------
$db_priority = 17;
-------------------------------------------------------
Priority => '005',
-------------------------------------------------------
sub build_sorthit {
# just priority
my (@unsorted) = @_;
my ($num) = ($#unsorted+1) / ($#db_cols+1);
my (%sortby, $hit, $i, @sorted, $column, $type);
for ($i = 0; $i < $num; $i++) {
$sortby{$i} = $unsorted[$db_sort_links + ($i * ($#db_cols+1))];
}
foreach $hit ( sort {
$sortby{$b} cmp $sortby{$a};
} (keys %sortby)) {
$first = ($hit * $#db_cols) + $hit;
$last = ($hit * $#db_cols) + $#db_cols + $hit;
push (@sorted, @unsorted[$first .. $last]);
}
return @sorted;
}
Gene
"The older I get, the more I admire competence, just simple competence in any field from adultery to zoology."