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

Jon Jensen <[email protected]>
Newsgroups gmane.comp.web.interchange.cvs
Message-ID <[email protected]>
commit cb2f14e4a8841d81467335ef09e8b38631d142c9
Author: Jon Jensen <[email protected]>
Date:   Wed Jan 25 14:57:25 2012 -0700

    Extend PREFIX-include to work in hash-based loops
    
    Submitted by Jeff Boes <[email protected]> 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})
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.