We're going to need more information. What are you doing with $sortfield. All the code does is keep changing it based on the existance of $IDNumber in %sort_file. Did you snip too much out of your loop? Did you mean to make $sortfield a hash or array of some sort. Your logic is sound up until that last if statement which just keeps changing the value of $sortfield over and over.
Later
P.S. Even if you are missing too much out of your loop, I think I spotted the logic error in your if statement. You assign $total_points when what you really want to assign is $sort_file{$IDNumber} since it is storing the value of $total_points for that hash key. Change it to:
if (exists ($sort_file{$IDNumber} )) { $sortfield = $sort_file{$IDNumber}; } else { $sortfield = ""; }
In reply to Re: sorting an array from two sources
by pzbagel
in thread sorting an array from two sources
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |