Test::Proto::Compare - base class for comparisons.
Test::Proto::Compare->new->compare('aaa', 'aab'); # -1
This is a base class for comparison functions.
Test::Proto::Compare->new(sub{lc shift cmp lc shift;});
The new function takes an argument, the coderef which is used to do the comparison. It is optional, and defaults to cmp.
cmp
$c->compare($a,$b);
This method will compare two arguments and return the result.
$c->reverse->compare($a,$b); # i.e. $c->compare($b,$a);
Calling this method will reverse the order in which the arguments are fed to the comparison functions.
For author, version, bug reports, support, etc, please see Test::Proto.
To install Test::Proto, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Proto
CPAN shell
perl -MCPAN -e shell install Test::Proto
For more information on module installation, please visit the detailed CPAN module installation guide.