You have a number of serious problems in this code, I'm afraid. I assume you succeeded in resolving those syntax errors at some point, since you say it never breaks out of the while loop, but since (as noted above) the code you posted does not compile, it's somewhat difficult to fix the logical errors.
However, since cLive ;-) seems to have given you some good advice on the compile-time problems, I'll try to guess what other problems you're about to run into. As I understand it, what you're trying to do is this:
for each column read each value in the column from the file perform a test on that value
The problem with the approach you're taking is that you're trying to read the file 682 times. While there's not necessarily a problem with that, you haven't taken any measures to make it work--you're ending the first run through at the end of the file, and you stay there for the rest of the script (look at seek for how to get around that).
If your table is merely in the range of 100s x 100s, though, I'd suggest instead reading the whole thing into memory: it's not necessarily scalable, but it's a heck of a lot easier to work with. Start with @lines = <FH>; just after you open it, and you can loop over it as many times as you like.
Alternatively, you can try the slightly more memory-hogging routine of
and using @lines as what passes in Perl for a 2D array. However, if that didn't make instant sense to you, you might want to avoid it. :-)while (<FH>) { push @lines, [split]; }
In reply to Re: How to control the loop
by ChemBoy
in thread How to control the loop
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |