do not use the $+{…} after the next match
authorHeiko Schlittermann (JUMPER) <hs@schlittermann.de>
Wed, 09 Apr 2014 16:15:12 +0200
changeset 6 363921354754
parent 5 bd0f8dc30ae0
child 7 30ae33129787
do not use the $+{…} after the next match
read-httpd-conf
--- a/read-httpd-conf	Wed Apr 09 15:47:15 2014 +0200
+++ b/read-httpd-conf	Wed Apr 09 16:15:12 2014 +0200
@@ -14,8 +14,9 @@
     say "# 1 $file";
     while (<$fh>) {
         if (/^\s*include\s+(?<quote>["'])?(?<file>.*?)\k<quote>?\s*$/i) {
-            my $file = $+{file} =~ m{^/} ? $+{file} : "$basedir/$+{file}";
-            say "# $. $file INCLUDE $+{file}";
+            my $file = $+{file};
+            $file = $+{file} =~ m{^/} ? $file : "$basedir/$file";
+            say "# $. $file INCLUDE $file";
             read_file($_, $basedir) foreach (glob -d $file ? "$file/*" : $file);
             next;
         }