reformatted [perltidy]
authorHeiko Schlittermann <hs@schlittermann.de>
Wed, 02 Dec 2009 07:48:00 +0100
changeset 2 5758f12ce2d7
parent 1 63072e0d02a6
child 3 eded7ab6b257
child 4 3e11dab11c4b
reformatted [perltidy]
postgrep
--- a/postgrep	Wed Dec 02 07:47:31 2009 +0100
+++ b/postgrep	Wed Dec 02 07:48:00 2009 +0100
@@ -16,20 +16,21 @@
 
 while (<>) {
 
-    if (!/^(?<date>.{15})
+    if (
+        !/^(?<date>.{15})
 	\s(?<host>\S+)
 	\s(?<service>\S+):
 	\s(?<pfid>[[:xdigit:]]+):
-	\s(?<rest>.*)/x) {
-
-	print "$_\n" if /$pattern/i;
-	next;
-
+	\s(?<rest>.*)/x
+      )
+    {
+        print "$_\n" if /$pattern/i;
+        next;
     }
 
     my $ts = str2time($+{date});
 
-    push @{$msglog{$+{pfid}}}, $_;
+    push @{ $msglog{ $+{pfid} } }, $_;
 
     # a "removed" line does not have to be the last
     # line for a message, sometimes the qmgr logs a bit
@@ -37,24 +38,23 @@
 
     # thus remember the "removed" ID we've seen
     if ($+{rest} eq "removed") {
-	push @{$removed{$ts}}, $+{pfid};
+        push @{ $removed{$ts} }, $+{pfid};
     }
 
     # and count all IDs with "removed" older than 60 seconds as
     # completed
     foreach (grep { ($ts - $_) > 60 } keys %removed) {
 
-	foreach (@{delete $removed{$_}}) {
-	    print @{delete $msglog{$_}}, "\n"
-		if /$pattern/i ~~ @{$msglog{$_}};
-	}
+        foreach (@{ delete $removed{$_} }) {
+            print @{ delete $msglog{$_} }, "\n"
+              if /$pattern/i ~~ @{ $msglog{$_} };
+        }
     }
 
-
 }
 
-# the rest 
+# the rest
 foreach (values %msglog) {
     print join @$_, "\n"
-	if /$pattern/ ~~ @{$msglog{$_}};
+      if /$pattern/ ~~ @{ $msglog{$_} };
 }