[interchange] Extend PREFIX-include to work in hash-based loops

Jon Jensen interchange-cvs at icdevgroup.org
Wed Jan 25 21:59:15 UTC 2012


commit cb2f14e4a8841d81467335ef09e8b38631d142c9
Author: Jon Jensen <jon at endpoint.com>
Date:   Wed Jan 25 14:57:25 2012 -0700

    Extend PREFIX-include to work in hash-based loops
    
    Submitted by Jeff Boes <jeff at endpoint.com> from a private commit as of
    2011-03-15, a copy of the same part of iterate_array_list, but original
    author/tester unknown.

 lib/Vend/Interpolate.pm |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/lib/Vend/Interpolate.pm b/lib/Vend/Interpolate.pm
index f16c6e1..668073f 100644
--- a/lib/Vend/Interpolate.pm
+++ b/lib/Vend/Interpolate.pm
@@ -4289,6 +4289,19 @@ sub iterate_hash_list {
 	$nc and local(@Hash_code{keys %$nc}) = values %$nc;
 
 #::logDebug("iterating hash $i to $end. count=$count opt_select=$opt_select hash=" . uneval($hash));
+
+    $text =~ s{
+        $B$QR{_include}
+    }{
+        my $filename = $1;
+
+        $Data_cache{"/$filename"} or do {
+            my $content = Vend::Util::readfile($filename);
+            vars_and_comments(\$content);
+            $Data_cache{"/$filename"} = $content;
+        };
+    }igex;
+
 	1 while $text =~ s#$IB$QR{_header_param_if}$IE[-_]header[-_]param\1\]#
 			  (defined $opt->{$3} ? $opt->{$3} : '')
 				  					?	pull_if($5,$2,$4,$opt->{$3})



More information about the interchange-cvs mailing list