wardy,
The more I look at it, the more it looks like the code:
foreach $row (@database_rows)
{
chomp $row;
@tmp = split (/\|/,$row);
$tmp_row = "$tmp[$sc_db_index_for_sort]\|$row";
push (@rows_to_sort,"$tmp_row\n");
}
@sorted_rows = sort(@rows_to_sort);
@database_rows = ();
foreach...