If
index was the problem, you should have been able to demonstrate it in two or three lines of code. We don't know what your data file(s) contain(s) (and I for one don't care to know), but you should be able to debug this program by throwing in some debug
print statements to display some of those variables before you do the
index, like
$line and $resort_lookup.