Sort::Key::OID - sort OIDs very fast
use Sort::Key::OID qw(oidsort); my @data = qw(1 1.2 1.1.3 1.4.1.1 1.5.235.2356 1.1); my @sorted = oidsort @data;
This module extends the Sort::Key family of modules to support sorting of OID values.
Also, once this module is loaded, the new type oid will be available from Sort::Key::Maker.
oid
Valid OIDs are sequences of unsigned integers separated by some symbol. For instance:
1.2.3.45 # valid 1-2-3-45 # valid 1 2 3 45 # valid 1:2:3:45 # valid 1..2.3.45 # invalid 1 2 3 45 # invalid 1:2.3 45 # invalid
The functions that can be imported from this module are:
returns the OID values in @data sorted.
@data
returns the OID values in @data sorted in descending order.
returns the elements on @array sorted by the OID keys resulting from applying them CALC_KEY.
@array
CALC_KEY
is similar to oidkeysort but sorts the elements in descending order.
oidkeysort
these functions are similar respectively to oidsort, roidsort, oidsortkey and roidsortkey, but they sort the array @data in place.
oidsort
roidsort
oidsortkey
roidsortkey
Sort::Key, Sort::Key::Maker
Copyright © 2007-2009 by Salvador Fandiño <sfandino@yahoo.com>.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install Sort::Key::OID, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sort::Key::OID
CPAN shell
perl -MCPAN -e shell install Sort::Key::OID
For more information on module installation, please visit the detailed CPAN module installation guide.