Thanks very much for your input, pzbagel.
I'm afraid I was careless in putting together my sample code. $sortfield is the first field of the db as follows:
($sortfield,$undef,$IDNumber,$Email_address,$Page_Name)=split (/\t/,$l
+ine);
What I want to achieve is each time the main db is iterated, the second db is serched for the IDNumber. If it exists the $total_points will be stored in the $sortfield for that line, otherwise it is undefined. I can then sort the main db according to the values of $sortfield.
I tried your update above, and thought it made sense. However it didn't work so I think my logic must be awry somewhere along the line.
Thanks once again |