Template::Plugin::String::Compare - TT extension for Template::Plugin::String objects
# This is not printed. [% IF '2005-03-01' < '2005-04-01' %] Normally this is evaluated in numeric context. [% END %] # This is printed. [% USE String.Compare %] [% IF String.Compare.new('2005-03-01') < '2005-04-01' %] This is evaluated in string context. [% END %]
This Template Toolkit plugin provides the way to compare string in string context. And this inherit from Template::Plugin::String. So you can use methods that Template::Plugin::String provides.
Compares the two strings.
[% USE String.Compare('001b') %] [% String.Compare.compare('001a') %] # => '1' [% String.Compare.compare('001b') %] # => '0' [% String.Compare.compare('001c') %] # => '-1'
Template, Template::Plugin::String
Satoshi Tanimoto, <tanimoto@cpan.org>
Copyright (C) 2005- by Satoshi Tanimoto
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Template::Plugin::String::Compare, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Template::Plugin::String::Compare
CPAN shell
perl -MCPAN -e shell install Template::Plugin::String::Compare
For more information on module installation, please visit the detailed CPAN module installation guide.