projects
/
liburi-template-perl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'upstream/0.20'
[liburi-template-perl.git]
/
lib
/
URI
/
Template.pm
diff --git
a/lib/URI/Template.pm
b/lib/URI/Template.pm
index
d96c895
..
edb1ce2
100644
(file)
--- a/
lib/URI/Template.pm
+++ b/
lib/URI/Template.pm
@@
-3,7
+3,7
@@
package URI::Template;
use strict;
use warnings;
use strict;
use warnings;
-our $VERSION = '0.
19
';
+our $VERSION = '0.
20
';
use URI;
use URI::Escape ();
use URI;
use URI::Escape ();
@@
-24,7
+24,8
@@
my %TOSTRING = (
sub new {
my $class = shift;
sub new {
my $class = shift;
- my $templ = shift || '';
+ my $templ = shift;
+ $templ = '' unless defined $templ;
my $self = bless { template => $templ, _vars => {} } => $class;
$self->_study;
my $self = bless { template => $templ, _vars => {} } => $class;
$self->_study;
@@
-287,11
+288,11
@@
sub _compile_expansion {
sub template {
my $self = shift;
sub template {
my $self = shift;
- my $
new_template
= shift;
+ my $
templ
= shift;
# Update template
# Update template
- if (
$new_template && $new_template
ne $self->{ template } ) {
- $self->{ template } = $
new_template
;
+ if (
defined $templ && $templ
ne $self->{ template } ) {
+ $self->{ template } = $
templ
;
$self->{ _vars } = {};
$self->_study;
return $self;
$self->{ _vars } = {};
$self->_study;
return $self;