use strict;
use warnings;
-our $VERSION = '0.19';
+our $VERSION = '0.20';
use URI;
use URI::Escape ();
sub new {
my $class = shift;
- my $templ = shift || '';
+ my $templ = shift;
+ $templ = '' unless defined $templ;
my $self = bless { template => $templ, _vars => {} } => $class;
$self->_study;
sub template {
my $self = shift;
- my $new_template = shift;
+ my $templ = shift;
# 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;