Got a simple issue that I can't work out! I'm reading a file line by line, and matching on lines with specific text. Then i want to iterate over that line and match against a list
But ... i'm just grabbing the first line that matches, iterating over that then exiting. I can't figure out how to return to the next file line and repeat the process !
foreach $confLine (<$in>) { if ($confLine =~ /ip4-address address=\"/) { foreach (<DATA>) { my $ip = $_; if ($confLine =~ /ip4-address address=\"$ip/) { $confLine =~ s/\/>/update\"\/>/; } } } print $out $confLine; } ___DATA___ 1.2.3.4 1.2.3.5
In reply to Return to original loop by stroke
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |