in reply to Search and replace.. ..a bit different
For those cases where you want to skip ahead a line, you can do something like this:foreach my $line (@netlist) { # ... }
Keep in mind that =~, and !~ are string comparisons using regular expressions. This is different from the regular string comparators 'eq' and 'ne' in that they check for matches, not equivalence.for (my $i = 0; $i < @netlist; $i++) { my $line = $netlist[$i]; if ($yadda_yadda) { $line = $netlist[++$i]; # ... } }
|
|---|