--- a/zone-rm.pl Tue Dec 21 13:55:01 2010 +0100
+++ b/zone-rm.pl Tue Dec 21 14:01:08 2010 +0100
@@ -6,14 +6,14 @@
use FindBin;
# liest die Konfiguration ein
-my @configs = ( "$FindBin::Bin/dnstools.conf", "/etc/dnstools.conf" );
+my @configs = ("$FindBin::Bin/dnstools.conf", "/etc/dnstools.conf");
my %config;
-foreach ( grep {-f} @configs ) {
- open( CONFIG, $_ ) or die "Can't open $_: $!\n";
+foreach (grep { -f } @configs) {
+ open(CONFIG, $_) or die "Can't open $_: $!\n";
}
-unless ( seek( CONFIG, 0, 0 ) ) {
+unless (seek(CONFIG, 0, 0)) {
die "Can't open config (searched: @configs)\n";
}
@@ -23,7 +23,7 @@
s/\t//g;
s/\s//g;
next unless length;
- my ( $cname, $ccont ) = split( /\s*=\s*/, $_, 2 );
+ my ($cname, $ccont) = split(/\s*=\s*/, $_, 2);
$config{$cname} = $ccont;
}
close(CONFIG);
@@ -32,19 +32,19 @@
my $conf_dir = $config{"zone_conf_dir"};
for (@ARGV) {
- chomp( my $zone = `idn --quiet "$_"` );
+ chomp(my $zone = `idn --quiet "$_"`);
- if ( -d "$master_dir/$zone" ) {
+ if (-d "$master_dir/$zone") {
rmtree "$master_dir/$zone/"
- and print "zone-dir for $zone removed\n";
+ and print "zone-dir for $zone removed\n";
}
else {
print "$master_dir/$zone: $!\n";
}
- if ( -e "$conf_dir/$zone" ) {
+ if (-e "$conf_dir/$zone") {
unlink "$conf_dir/$zone"
- and print "configuration-file for $zone removed\n";
+ and print "configuration-file for $zone removed\n";
}
else {
print "$conf_dir/$zone: $!\n";