--- interpolate_conditional.orig Mon Nov 17 22:04:24 2003 +++ interpolate_conditional Mon Nov 17 22:04:30 2003 @@ -40,8 +40,12 @@ $template =~ s#\?\{(\$\w+(?:::)?\w*)<(.*?) (.*?)\}#"defined $1 and $1 lt '$2' ? \$3 : ''"#gee; # unconditional (and recursive) - while( $template =~ s/(\$[a-zA-Z]\w+(?:::)?\w*)/"defined $1 ? $1 : ''"/gee ) { } - + # Mark Ivey: Don't interpolate on $$variable. Also, match single letter variables. + while( $template =~ s/(^|[^\$])(\$[a-zA-Z]\w*(?:::)?\w*)/$1 = "" unless defined $1; defined eval $2 ? $1.eval($2) : $1/ge ) { }; + #while( $template =~ s/(\$[a-zA-Z]\w+(?:::)?\w*)/"defined $1 ? $1 : ''"/gee ) { } + + # discard double $$ + $template =~ s/\$\$/\$/g; return $template; }; @@ -104,6 +108,12 @@ ?{$writeback::count>50 oodles of writebacks} + * Don't interpolate + + e.g. include "$title" not the value of $title + + $$title + Overrides Blosxom's default interpolate() subroutine. =head1 INSTALLATION