Sort::Key::LargeInt - sort large integers very fast
use Sort::Key::LargeInt qw(largeintsort); my @data = qw(+8970938740872304 -12 98_908_345_309_345_345_353_453_466_545_645_676_567 ...); my @sorted = largeintsort @data;
This module extends the Sort::Key family of modules to support sorting strings containing integer numbers of arbitrary length (referred by this module as large-integers) numerically.
Large-integers must match the following regular expresion:
/^[+\-]?[\d_]*$/
The functions that can be imported from this module are:
returns the large-integer values in @data sorted.
@data
returns the large-integer values in @data sorted in descending order.
returns the elements on @array sorted by the large-integer keys resulting from applying them CALC_KEY.
@array
CALC_KEY
is similar to largeintkeysort but sorts the elements in descending order.
largeintkeysort
these functions are similar respectively to largeintsort, rlargeintsort, largeintsortkey and rlargeintsortkey, but they sort the array @data in place.
largeintsort
rlargeintsort
largeintsortkey
rlargeintsortkey
Sort::Key, Sort::Key::Maker
Copyright © 2009 by Salvador Fandiño
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.
To install Sort::Key::LargeInt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sort::Key::LargeInt
CPAN shell
perl -MCPAN -e shell install Sort::Key::LargeInt
For more information on module installation, please visit the detailed CPAN module installation guide.