SPVM::Comparator::String - a callback interface for string comparation
use SPVM::Comparator::String; my $comparator : SPVM::Comparator::String = sub : int ($self : self, $a : string, $b : string); { return $a cmp $b; }; my $result = $comparator->(3, 5);
SPVM::Comparator::String is a callback interface to compare two strings.
sub : int ($self : self, $a : string, $b : string);
This method must receive two strings and return 1 if $a is more than $b, -1 if $x is less than $b, 0 if $a equals $b in the implementation.
This method is planned to be implemented in other classes.
To install SPVM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPVM
CPAN shell
perl -MCPAN -e shell install SPVM
For more information on module installation, please visit the detailed CPAN module installation guide.