[perltidy]
authorHeiko Schlittermann (JUMPER) <hs@schlittermann.de>
Wed, 28 Jan 2015 23:44:49 +0100
changeset 85 0941dc67002c
parent 84 0d9901b561f7
child 86 b5c670b12e26
[perltidy]
bin/dnsvi
lib/DNS/Vi.pm
--- a/bin/dnsvi	Wed Jan 28 23:44:10 2015 +0100
+++ b/bin/dnsvi	Wed Jan 28 23:44:49 2015 +0100
@@ -42,8 +42,7 @@
     my %auth = get_auth_info shift @ARGV;
     my $zone = $auth{name};
 
-    $o{server} =
-      $o{local} ? 'localhost' : $auth{mname}
+    $o{server} = $o{local} ? 'localhost' : $auth{mname}
       if not defined $o{server};
 
     my @dig = (
@@ -99,8 +98,8 @@
 
     given ($_) {
         when ('y') { }
-	when ('q') { }
-	when ('V') { }
+        when ('q') { }
+        when ('V') { }
         when ('Q') { return 1 }
         when ('e') { goto EDIT }
         when ('v') { goto VIEW }
@@ -125,7 +124,7 @@
         \@zone1,
         @delta{qw/add del/},
         {
-	    $_ eq 'V' ? (-dry => 1) : (),
+            $_ eq 'V' ? (-dry => 1) : (),
             -server => $o{server},
             -local  => $o{local},
             -debug  => $o{debug},
@@ -133,10 +132,10 @@
         }
       )
       or do {
-	  if ($backup) {
-	    copy($backup->filename, ",dnsvi-$$")
-	    and say "Saved as ',dnsvi-$$'";
-	  }
+        if ($backup) {
+            copy($backup->filename, ",dnsvi-$$")
+              and say "Saved as ',dnsvi-$$'";
+        }
       };
 
     goto CONFIRM if $_ eq 'V';
--- a/lib/DNS/Vi.pm	Wed Jan 28 23:44:10 2015 +0100
+++ b/lib/DNS/Vi.pm	Wed Jan 28 23:44:49 2015 +0100
@@ -10,7 +10,6 @@
 use base 'Exporter';
 use if $] >= 5.020, experimental => 'smartmatch';
 
-
 our @EXPORT = qw(ttl2h h2ttl parse delta nice edit update show get_key
   get_auth_info);
 our @EXPORT_OK = ();
@@ -286,18 +285,20 @@
     my %auth = (zone => undef, master => undef);
     state $resolver = Net::DNS::Resolver->new;
     my $response = $resolver->send($name, 'SOA')
-	or die $resolver->errorstring, "\n";
+      or die $resolver->errorstring, "\n";
 
-#    use Data::Dumper;
-#    die Dumper $response;
+    #    use Data::Dumper;
+    #    die Dumper $response;
 
-    if (my @soa = grep { $_->type eq 'SOA' } $response->answer, $response->authority) {
-	die "got multiple soa records\n" if @soa > 1;
-	my $soa = $soa[0];
-	return (
-	    name => $soa->name,
-	    mname => $soa->mname,
-	)
+    if (my @soa = grep { $_->type eq 'SOA' } $response->answer,
+        $response->authority)
+    {
+        die "got multiple soa records\n" if @soa > 1;
+        my $soa = $soa[0];
+        return (
+            name  => $soa->name,
+            mname => $soa->mname,
+        );
     }
 
     return $response->authority;