I'm not sure what you mean by "[w]hen I do one "if" statement, it skips over the second, and so on. Second "if" only works when I restate the "while" and so on". Could you clarify?
I'm guessing that your problem's to do with the fact you're exhausting your filehandle. while(<WGL>) will read the entire file, line by line; if you then attempt to read from it again, e.g. in a second while loop further down in a similar block of code, it'll try to continue where you last left off, notice it's already at the end of the file, and not execute the loop body even once.
That's easily remedied by using seek, though: seek WGL, 0, SEEK_SET will move the filehandle's position to the beginning of the file again.
Is that the problem you're having?
In reply to Re: Nested if and while statements
by AppleFritter
in thread Nested if and while statements
by crisa89
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |