in reply to How do I select first string of a two dimensional array to compare to other values?
It certainly looks to me that the print statement is within the while loop, such that it will print every value retrieved from the file-handle. You do need the loop, presumably, because you have a next if test to exclude certain lines. But, once you reach the point where the print statement is now located, you probably (instead ...) want to use a last statement to force a premature end to the while-loop: the first value is now in $first_value, and you do not wish to continue reading. After the } symbol which ends the while-loop, you can, if you like, put the print statement to see it.
If, later on in the program, you start another while loop using the same file-handle, it should resume reading the file where it left off. (Unless you use fseek() to reposition it.)
- - -
(In the future, it will help us considerably if you’ll routinely tell us more information: a snippet of what the file looks like, and a brief description of what output you are seeing and why you feel that the output is wrong.) Meanwhile, Welcome to the Monastery!!