XP is just a number | |
PerlMonks |
Reset while loop to beginning of hash when using 'each'by seaver (Pilgrim) |
on Sep 25, 2003 at 23:09 UTC ( [id://294285]=perlquestion: print w/replies, xml ) | Need Help?? |
seaver has asked for the wisdom of the Perl Monks concerning the following question:
Dear all,
I am looping through the keys of a hash like so:
LINE refers to the while loop that is looping through the file, and each $line of the file, if it meets the requirements, is used. However, the inner while loop shown above does not reset itself, consequently, the next $line doesnt have stuff happening to it, because no $ats matches it, THEN, because the while loop reaches the end of the hash, it goes back and does it again, but to the NEXT line in the file. The result of which seems like this loop is skipping every other $ats I'm trying to find information on resetting while loops, but, though I've found something on making the $_ local, it doesnt seem to apply here? Anyone know what to do? Cheers
Back to
Seekers of Perl Wisdom
|
|