in reply to Looping through end of file once a match is found
My guess is that you do not know what exactly next does.
Here is the basic idea: it stops the execution of the current block with the current item, and start all over again with the next item.
In your code the following two lines will never be executed:
print RESULTS "$currentfile"; } until eof();
My guess is that you think it will store the next entry in $currentfile and continue right after the next LINE. This is not the case.
You could replace the do { } until block with another while (<FILE>) { } or you can go with the suggestion other have already made. (Which are better!)
|
|---|