Element for the list context sigil '@' which forces list context on function/methods calls and unpacks list references.
This module implements a subclass of
Template::TT3::Element::Sigil
for representing the list context sigil @
.
It is used to extract the value pairs of a list reference.
[% foo = [1, 2, 3] bar = [4, 5, 6] baz = [@foo, @bar] # same as: baz = [1, 2, 3, 4, 5, 6] %]
If its target expression is a function then it will be called in list context.
[% bar() %] # called in scalar context by default [% @bar() %] # called in explicit list context
It is also used in function signatures to indicate a list variable that should collect all additional positional arguments.
[% foo(@list) = "You called foo() with $list.join" %] [% foo(10,20,30) %] # You called foo() with 10 20 30
This module implements the following methods in addition to those inherited from the Template::TT3::Element::Sigil , Template::TT3::Element , Template::TT3::Base and Badger::Base base classes.
Andy Wardley http://wardley.org
Copyright (C) 1996-2009 Andy Wardley. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.