:D *awesome* now I'm getting it

Autovivification? This is the code

$stash->set('g', $stash->get(['group', 0, 1, 0]));

So testing it outside of tpage , it returns empty string instead of undef

#!/usr/bin/perl -- use strict; use warnings; use Data::Dump qw/ dd /; use Template::Stash; use Template::Stash::XS; for my $stash ( Template::Stash::XS->new, Template::Stash->new ){ $stash->set('group', [ 'one' ]); $stash->set('g', $stash->get(['group', 0, 1, 0])); dd( $stash->get('g' ) ); $stash->set('g', $stash->get(['group', 0, 1, 0, 'defined', 0])); dd( $stash->get('g' ) ); $stash->set('g', $stash->get(['g', 0, 'defined', 0])); dd( $stash->get('g' ) ); dd( $stash->set('undy', undef ) ); dd( $stash->get('undy' ) ); dd( $stash ); } __END__ $ perl template-stash-bug.pl "" "" 1 "" "" bless({ _PARENT => undef, dec => sub { ... }, g => 1, global => {}, group => ["one"], inc => sub { ... }, undy => undef, }, "Template::Stash::XS") "" "" 1 "" "" bless({ _PARENT => undef, dec => sub { ... }, g => 1, global => {}, group => ["one"], inc => sub { ... }, undy => undef, }, "Template::Stash")

None of the various https://metacpan.org/source/ABW/Template-Toolkit-2.26/t/stash.t seem to test defined

But docs show https://metacpan.org/pod/Template::Stash#undefined-ident-args which links https://metacpan.org/pod/Template::Manual::Config#STRICT

Which says its a regrettable design decision, so I guess not a bug

tpage/ttree don't have / take a -template_strict option


In reply to Re^5: Template::Toolkit: defined on aggregate item vs. defined on variable (STRICT) by beech
in thread Template::Toolkit: defined on aggregate item vs. defined on variable by flowdy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.