in reply to Search and replace.. ..a bit different

First, instead of repeately using shift, you might just want to use a foreach or maybe even a for:
foreach my $line (@netlist) { # ... }
For those cases where you want to skip ahead a line, you can do something like this:
for (my $i = 0; $i < @netlist; $i++) { my $line = $netlist[$i]; if ($yadda_yadda) { $line = $netlist[++$i]; # ... } }
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.

As for what you mean by for ($line), you probably want to pass it an array or a list rather than a single element.

IMHO, I don't think you're approaching this correctly. Think first, code second. You seem to be doing the reverse. You will probably have better results if you can think your problem through completely in terms of functionality and then translate these thoughts into Perl.