NAME

Template::Plugin::String::Compare - TT extension for Template::Plugin::String objects

SYNOPSIS

# 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 %]

DESCRIPTION

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.

METHODS

compare($text)

Compares the two strings.

[% USE String.Compare('001b') %]
[% String.Compare.compare('001a') %] # => '1'
[% String.Compare.compare('001b') %] # => '0'
[% String.Compare.compare('001c') %] # => '-1'

SEE ALSO

Template, Template::Plugin::String

AUTHOR

Satoshi Tanimoto, <tanimoto@cpan.org>

COPYRIGHT AND LICENSE

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.