Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/Template.pm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use Scalar::Util qw(blessed);
our $VERSION = '3.106';
our $ERROR = '';
our $DEBUG = 0;
our $BINMODE = 0 unless defined $BINMODE;
our $BINMODE //= 0;
our $AUTOLOAD;

# preload all modules if we're running under mod_perl
Expand Down
4 changes: 2 additions & 2 deletions lib/Template/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use base 'Template::Base';
our $VERSION = '3.106';

our $DEBUG;
$DEBUG = 0 unless defined $DEBUG;
$DEBUG //= 0;
our $ERROR = '';
our $CONTEXT = 'Template::Context';
our $FILTERS = 'Template::Filters';
Expand All @@ -35,7 +35,7 @@ our $PLUGINS = 'Template::Plugins';
our $PROVIDER = 'Template::Provider';
our $SERVICE = 'Template::Service';
our $STASH;
$STASH = 'Template::Stash::XS';
$STASH = 'Template::Stash';
our $CONSTANTS = 'Template::Namespace::Constants';

our $LATEX_PATH;
Expand Down
2 changes: 1 addition & 1 deletion lib/Template/Context.pm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use constant BADGER_EXCEPTION => 'Badger::Exception';
use constant MSWin32 => $^O eq 'MSWin32';

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;
our $DEBUG_FORMAT = "\n## \$file line \$line : [% \$text %] ##\n";
our $VIEW_CLASS = 'Template::View';
our $AUTOLOAD;
Expand Down
6 changes: 3 additions & 3 deletions lib/Template/Directive.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ use Template::Constants;
use Template::Exception;

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $WHILE_MAX = 1000 unless defined $WHILE_MAX;
our $PRETTY = 0 unless defined $PRETTY;
our $DEBUG //= 0;
our $WHILE_MAX //= 1000;
our $PRETTY //= 0;
our $OUTPUT = '$output .= ';


Expand Down
4 changes: 2 additions & 2 deletions lib/Template/Document.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use base 'Template::Base';
use Template::Constants;

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;
our $ERROR = '';
our ($COMPERR, $AUTOLOAD, $UNICODE);

Expand Down Expand Up @@ -286,7 +286,7 @@ sub write_perl_file {
my ($class, $file, $content) = @_;
my ($fh, $tmpfile);

return $class->error("invalid filename: " . (defined $file ? $file : ''))
return $class->error("invalid filename: " . ($file // ''))
unless defined $file && length $file;

eval {
Expand Down
2 changes: 1 addition & 1 deletion lib/Template/Iterator.pm
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use constant ODD => 'odd';
use constant EVEN => 'even';

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;
our $AUTOLOAD;

#========================================================================
Expand Down
2 changes: 1 addition & 1 deletion lib/Template/Map.pm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use warnings;
use base 'Template::Base';

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;
our $MAP = {
HASH => 'hash',
ARRAY => 'list',
Expand Down
2 changes: 1 addition & 1 deletion lib/Template/Namespace/Constants.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use Template::Directive;
use Template::Exception;

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;


sub _init {
Expand Down
2 changes: 1 addition & 1 deletion lib/Template/Parser.pm
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ use constant ERROR => 2;
use constant ABORT => 3;

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;
our $ERROR = '';

# The ANYCASE option can cause conflicts when reserved words are used as
Expand Down
2 changes: 1 addition & 1 deletion lib/Template/Plugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use warnings;
use base 'Template::Base';

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;
our $ERROR = '';
our $AUTOLOAD;

Expand Down
2 changes: 1 addition & 1 deletion lib/Template/Plugin/Dumper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use base 'Template::Plugin';
use Data::Dumper;

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;
our @DUMPER_ARGS = qw( Indent Pad Varname Purity Useqq Terse Freezer
Toaster Deepcopy Quotekeys Bless Maxdepth Sortkeys );
our $AUTOLOAD;
Expand Down
2 changes: 1 addition & 1 deletion lib/Template/Plugin/Filter.pm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use Scalar::Util 'weaken', 'isweak';


our $VERSION = '3.106';
our $DYNAMIC = 0 unless defined $DYNAMIC;
our $DYNAMIC //= 0;


sub new {
Expand Down
2 changes: 1 addition & 1 deletion lib/Template/Plugin/Procedural.pm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use warnings;
use base 'Template::Plugin';

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;
our $AUTOLOAD;

#------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions lib/Template/Plugins.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use base 'Template::Base';
use Template::Constants;

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;
our $PLUGIN_BASE = 'Template::Plugin';
our $STD_PLUGINS = {
'assert' => 'Template::Plugin::Assert',
Expand Down Expand Up @@ -88,7 +88,7 @@ sub fetch {

$self->debug("fetch($name, ",
defined $args ? ('[ ', join(', ', @$args), ' ]') : '<no args>', ', ',
defined $context ? $context : '<no context>',
$context // '<no context>',
')') if $self->{ DEBUG };

# NOTE:
Expand Down
12 changes: 6 additions & 6 deletions lib/Template/Provider.pm
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ use constant STAT => 5; # Time last stat()ed
use constant MSWin32 => $^O eq 'MSWin32';

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;
our $ERROR = '';

# name of document class
our $DOCUMENT = 'Template::Document' unless defined $DOCUMENT;
our $DOCUMENT //= 'Template::Document';

# maximum time between performing stat() on file to check staleness
our $STAT_TTL = 1 unless defined $STAT_TTL;
our $STAT_TTL //= 1;

# maximum number of directories in an INCLUDE_PATH, to prevent runaways
our $MAX_DIRS = 64 unless defined $MAX_DIRS;
our $MAX_DIRS //= 64;

# UNICODE is supported in versions of Perl from 5.007 onwards
our $UNICODE = $] > 5.007 ? 1 : 0;
Expand Down Expand Up @@ -357,7 +357,7 @@ sub _init {
local $" = ', ';
$self->debug(
"creating cache of ",
defined $size ? $size : 'unlimited',
$size // 'unlimited',
" slots for [ @$path ]"
);
}
Expand Down Expand Up @@ -851,7 +851,7 @@ sub _compile {
my ($parsedoc, $error);

$self->debug("_compile($data, ",
defined $compfile ? $compfile : '<no compfile>', ')')
$compfile // '<no compfile>', ')')
if $self->{ DEBUG };

my $parser = $self->{ PARSER }
Expand Down
4 changes: 2 additions & 2 deletions lib/Template/Service.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use Scalar::Util 'blessed';
use constant EXCEPTION => 'Template::Exception';

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;
our $ERROR = '';


Expand All @@ -58,7 +58,7 @@ sub process {

$self->debug(
"process($template, ",
defined $params ? $params : '<no params>',
$params // '<no params>',
')'
) if $self->{ DEBUG };

Expand Down
2 changes: 1 addition & 1 deletion lib/Template/Stash.pm
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use Template::Exception;
use Scalar::Util qw( blessed reftype );

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;
our $PRIVATE = qr/^[_.]/;
our $UNDEF_TYPE = 'var.undef';
our $UNDEF_INFO = 'undefined variable: %s';
Expand Down
2 changes: 1 addition & 1 deletion lib/Template/Stash/Context.pm
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ use warnings;
use base 'Template::Stash';

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;


#========================================================================
Expand Down
4 changes: 2 additions & 2 deletions lib/Template/VMethods.pm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ use Scalar::Util qw( blessed looks_like_number );
use Template::Filters;

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;

our $ROOT_VMETHODS = {
inc => \&root_inc,
Expand Down Expand Up @@ -559,7 +559,7 @@ sub list_reverse {

sub list_grep {
my ($list, $pattern) = @_;
$pattern = '' unless defined $pattern;
$pattern //= '';
return [ grep /$pattern/, @$list ];
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Template/View.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use warnings;
use base 'Template::Base';

our $VERSION = '3.106';
our $DEBUG = 0 unless defined $DEBUG;
our $DEBUG //= 0;
our @BASEARGS = qw( context );
our $AUTOLOAD;
our $MAP = {
Expand Down