It's not the loop structure, it's the variable. You're setting $i to every element of @newips, but printing $_. Either change the foreach to use $_, like so:
Or change the print:foreach (@newips) {
print OUTFILE $i if ...
HTH
In reply to Re: Correct Loop Structure
by VSarkiss
in thread Correct Loop Structure
by Dru
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |