[perltidy] und @ARGV
authorHeiko Schlittermann (JUMPER) <hs@schlittermann.de>
Thu, 30 Jan 2014 15:31:48 +0100
changeset 1 992581cd9e89
parent 0 6e5a0f90db08
child 2 514fe7b72d65
child 4 68f19d9cfd9a
[perltidy] und @ARGV
read-httpd-conf
--- a/read-httpd-conf	Fri Dec 06 10:10:09 2013 +0100
+++ b/read-httpd-conf	Thu Jan 30 15:31:48 2014 +0100
@@ -5,21 +5,22 @@
 use Carp;
 
 sub read_file {
-	my $file = shift;
-	open(my $fh, '<', $file)
-		or croak "Can't open $file: $!\n";
-	say "# 1 $file";
-	while (<$fh>) {
-		if (/^\s*include\s+(?<quote>["'])?(?<file>.*?)\k<quote>?\s*$/i) {
-			#print "#$file:$.:$_";
-			say "# $. $file INCLUDE $+{file}";
-			read_file($_) foreach (glob $+{file});
-			next;
-		}
-		print;
-	}
+    my $file = shift;
+    open(my $fh, '<', $file)
+      or croak "Can't open $file: $!\n";
+    say "# 1 $file";
+    while (<$fh>) {
+        if (/^\s*include\s+(?<quote>["'])?(?<file>.*?)\k<quote>?\s*$/i) {
+
+            #print "#$file:$.:$_";
+            say "# $. $file INCLUDE $+{file}";
+            read_file($_) foreach (glob $+{file});
+            next;
+        }
+        print;
+    }
 }
 
-die "$0: Need file name (httpd.conf)\n" 
-    unless $@;
+die "$0: Need file name (httpd.conf)\n"
+  unless @ARGV;
 read_file(shift);