in reply to sorting an array from two sources
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 = ""; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: sorting an array from two sources
by Anonymous Monk on Oct 21, 2003 at 22:56 UTC |