Skip Menu |

This queue is for tickets about the Template-Plugin-Subst CPAN distribution.

Report information
The Basics
Id: 15691
Status: resolved
Priority: 0/
Queue: Template-Plugin-Subst

People
Owner: Nobody in particular
Requestors: gary_ashton-jones [...] rta.nsw.gov.au
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Global symbol "$global" requires explicit package name
I'm not sure which version of Perl you are running (perhaps you need to specify a minimum version), but with v5.8.7 I get an error when '//' is used as a binary operator on line 64 (see attached file). Did you mean to use '||'?
--- lib/Template/Plugin/Subst.pm 2005-11-11 10:47:35.000000000 +1100 +++ tmp1 2005-11-11 10:49:15.000000000 +1100 @@ -61,7 +61,7 @@ my $pattern = $config->{'pattern'}; my $replacement = $config->{'replacement'}; - my $global = $config->{'global'} // 1; + my $global = $config->{'global'} || 1; # warn "pattern: $pattern, replacement: $replacement\n"; $text = subst($text, $pattern, $replacement, $global); @@ -72,7 +72,7 @@ sub subst { my($text, $pattern, $replacement, $global) = @_; - $global = $global // 1; + $global = $global || 1; # warn "-> subst() ('$pattern', '$replacement')\n"; if($text !~ m/$pattern/) {
Cheers. Just fixed this, '//' as an operator isn't available in older Perl's. Version 0.02, to be uploaded shortly, will contain the fix.