SPVM::Comparator::Long - a callback type for long comparation
use SPVM::Comparator::Long; my $comparator : SPVM::Comparator::Long = sub : int ($self : self, $a : long, $b : long); { return $a <=> $b; }; my $result = $comparator->(3, 5);
SPVM::Comparator is a callback type to compare two numbers.
sub : int ($self : self, $a : long, $b : long);
This method should receive two numbers and return 1 if $a is more than $b, -1 if $x is lass than $b, 0 if $a equals $b in the implementation.
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.