X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fblosxom-plugins.git;a=blobdiff_plain;f=general%2Finterpolate_conditional;h=264695bedfcb900980efcbed922062cc7e06737d;hp=02130ba70b34130e1211696498fece6721c0994b;hb=HEAD;hpb=ebb08aa6d3f16303068fc794c1135dcbc8a5be0e diff --git a/general/interpolate_conditional b/general/interpolate_conditional index 02130ba..264695b 100644 --- a/general/interpolate_conditional +++ b/general/interpolate_conditional @@ -22,25 +22,25 @@ sub interpolate { my $template = shift; # defined - $template =~ s#\?\{(\$\w+(?:::)?\w*) (.*?)\}#"defined $1 ? \$2 : ''"#gee; + $template =~ s#\?\{(\$\w+(?:::\w+)*) (.*?)\}#"defined $1 ? \$2 : ''"#gee; # not defined - $template =~ s#\?\{!(\$\w+(?:::)?\w*) (.*?)\}#"!defined $1 ? \$2 : ''"#gee; + $template =~ s#\?\{!(\$\w+(?:::\w+)*) (.*?)\}#"!defined $1 ? \$2 : ''"#gee; # not equal to - $template =~ s#\?\{(\$\w+(?:::)?\w*)!=(.*?) (.*?)\}#"defined $1 and $1 ne '$2' ? \$3 : ''"#gee; + $template =~ s#\?\{(\$\w+(?:::\w+)*)!=(.*?) (.*?)\}#"defined $1 and $1 ne '$2' ? \$3 : ''"#gee; # equal to - $template =~ s#\?\{(\$\w+(?:::)?\w*)=(.*?) (.*?)\}#"defined $1 and $1 eq '$2' ? \$3 : ''"#gee; + $template =~ s#\?\{(\$\w+(?:::\w+)*)=(.*?) (.*?)\}#"defined $1 and $1 eq '$2' ? \$3 : ''"#gee; # greater than - $template =~ s#\?\{(\$\w+(?:::)?\w*)>(.*?) (.*?)\}#"defined $1 and $1 gt '$2' ? \$3 : ''"#gee; + $template =~ s#\?\{(\$\w+(?:::\w+)*)>(.*?) (.*?)\}#"defined $1 and $1 gt '$2' ? \$3 : ''"#gee; # less than - $template =~ s#\?\{(\$\w+(?:::)?\w*)<(.*?) (.*?)\}#"defined $1 and $1 lt '$2' ? \$3 : ''"#gee; + $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 ) { } + while( $template =~ s/(\$[a-zA-Z]\w+(?:::\w+)*)/"defined $1 ? $1 : ''"/gee ) { } return $template; @@ -118,20 +118,23 @@ Drop the interpolate_conditional plug-in into your Blosxom plugins folder. Rael Dornfest , http://www.raelity.org/ +This plugin is now maintained by the Blosxom Sourceforge Team, +. + =head1 ACKNOWLEDGEMENTS Eric David Sherman, for < and > =head1 SEE ALSO -Blosxom Home/Docs/Licensing: http://www.raelity.org/apps/blosxom/ +Blosxom Home/Docs/Licensing: http://blosxom.sourceforge.net/ -Blosxom Plugin Docs: http://www.raelity.org/apps/blosxom/plugin.shtml +Blosxom Plugin Docs: http://blosxom.sourceforge.net/documentation/users/plugins.html =head1 BUGS -Address bug reports and comments to the Blosxom mailing list -[http://www.yahoogroups.com/group/blosxom]. +None known; please send bug reports and feedback to the Blosxom +development mailing list . =head1 LICENSE