NAME

Top Close Open

Template:TT3::Element::Sigil::Hash - element representing the % sigil

DESCRIPTION

Top Close Open

This module implements a subclass of Template::TT3::Element::Sigil for representing the hash context sigil %.

It is used to extract the key/value pairs of a hash array.

[% foo = { a=10, b=20 }
   bar = { c=30, d=40 }
   baz = { %foo, %bar }     # baz contains a=10, b=20, c=30, d=40
%]

It is also used in function signatures to indicate a hash variable that should collect all additional named parameters.

[% foo(%hash) = "You called foo() with $hash.keys.sort.join" %]
[% foo(a=10, b=20) %]    # You called foo() with a b

METHODS

Top Close Open

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.

text()

Top Close Open

value()

Top Close Open

values()

Top Close Open

AUTHOR

Top Close Open

Andy Wardley http://wardley.org

COPYRIGHT

Top Close Open

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.


http://tt3.template-toolkit.org/docs/Template/TT3/Element/Sigil/Hash.pm last modified 2009-11-26 15:27:13