From: Barijaona Ramaholimihaso Date: Thu, 27 Sep 2007 16:22:35 +0000 (+0000) Subject: Enables variable names with multiple :: separators X-Git-Url: https://git.stderr.nl/gitweb?a=commitdiff_plain;h=321b0f73a7a6d0b08b66e17a72899faac17f540d;p=matthijs%2Fupstream%2Fblosxom-plugins.git Enables variable names with multiple :: separators --- diff --git a/general/interpolate_conditional b/general/interpolate_conditional index 255bb18..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;