Template::Plugin::HashMerge - TT2 plugin to use Hash::Merge
[% USE HashMerge %] [% a = { foo => 1, bar => [ 'a', 'b', 'e' ], baz => { bob => 'alice', }, }; b = { foo => 2, bar => [ 'c', 'd' ], baz => { ted => 'margeret', }, }; HashMerge.set_behaviour( 'RIGHT_PRECEDENT' ); c = HashMerge.merge( a, b ); %]
Template::Toolkit plugin HashMerge provides the Hash::Merge functions merge and set_behaviour to be used within templates.
merge
set_behaviour
This can be useful in all cases a template works directly on data - e.g. when processing results from a query using Template::DBI and join the result with results from derived queries.
[% USE HashMerge %] [% HashMerge.set_behaviour( <behaviour name> ); result = HashMerge.merge( hash1, hash2 ); %]
Detailed function description and default behaviours are available in Hash::Merge.
If you prefer to use virtual hash methods, see Template::Plugin::HashMergeVMethods.
To install this module, use
perl Build.PL ./Build ./Build test ./Build install
None known.
Free support can be requested via regular CPAN bug-tracking system. There is no guaranteed reaction time or solution time. It depends on business load. That doesn't mean that ticket via rt aren't handles as soon as possible, that means that soon depends on how much I have to do.
Business and commercial support should be aquired via preferred freelancer agencies.
Jens Rehsack CPAN ID: REHSACK rehsack@cpan.org http://search.cpan.org/~rehsack/
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
perl(1), Template::Toolkit
To install Template::Plugin::HashMerge, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Plugin::HashMerge
CPAN shell
perl -MCPAN -e shell install Template::Plugin::HashMerge
For more information on module installation, please visit the detailed CPAN module installation guide.