get#
The value of a template variable: $ident is a name, a dotted name such as 'user.name' (arguments in parentheses are dropped), or a list [ name => \@args, name => \@args, ... ]; \@args as a third argument is passed to a plain name that is a code ref or method.
Synopsis#
$stash->get('title');
$stash->get('user.name');
$stash->get([ 'user', 0, 'greet', [ 'Hello' ] ]);
Edge cases#
A variable that is not defined is passed to
$stash->undefined, whose value is returned (Template::Stash’s returns an empty string, or dies underSTRICT).A reference other than a list ref as
$identdies “Template::Stash::XS: get (arg 2) must be a scalar or listref”.A true
_DEBUGin the stash makes a missing variable die “NAME is undefined”.