you should really have this:if ($_ !~ /^zone \"$domain\" \{/ .. /\}\;/)
unless (/^zone \"$domain\" \{/ .. /\}\;/)
Why? In your version you use the (/A/ .. /B/) syntax to extract a range of lines between /A/ being true and /B/ being true. When you test for ($_ !~ /A/ .. /B/) then you get everything between /A/ being false and /B/ being true. That's not what you want.
buckaduck
In reply to Re: Removing lines from a file.
by buckaduck
in thread Removing lines from a file.
by mofo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |