in reply to Correct Loop Structure
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
|
|---|