#!/usr/bin/perl -w use strict; print " please enter the domain name: "; my $targetdomain = ; my $susdate = `date -u "+%m/%d/%Y %H:%M"`; my $char = "This Domain is Suspended at "; chomp $targetdomain; my $file = "/home/adam/Desktop/hello"; rename $file, "$file.bak" or die "Can't rename file '$file': $!\n"; open my $in, '<', "$file.bak" or die "Can't read file '$file': $!\n"; open my $out, '>', $file or die "Can't write file '$file': $!\n"; my $comment =0; my $block = 0; while(<$in>) { if (/^zone\s+"$targetdomain"/) { s// /; $comment++; $block += () = /(\{)/g; } if($comment) { $block += () = /(\{)/g; $block -= () = /(\})/g; $comment = 0 unless $block; } print $out $_; }