Sort::Key::Domain - Sort domain names
use Sort::Key::Domain qw(domainkeysort); my @sorted = domainkeysort { $_->domain_name } @url;
This module extends the Sort::Key family of modules to support sorting of domain names.
The functions that can be imported from this module are as follow:
Return the domain names in @data sorted.
@data
Returns the domain names in @data sorted in descending order.
Returns the elements on @array sorted by the domain name resulting from applying them CALC_KEY.
@array
CALC_KEY
Returns the elements on @array sorted by the domain name resulting from applying them CALC_KEY but in descending order.
Transforms the given domain name in a key suitable for lexicographically sorting.
Specifically it reverses the subdomains in the string. For instance, the domain name a.b.c is converted into c.b.a. An interesting property of this transformation is that applying a second time just undoes it.
a.b.c
c.b.a
These functions are similar respectively to domainsort, rdomainsort, domainsortkey and rdomainsortkey, but they sort the array @data in place.
domainsort
rdomainsort
domainsortkey
rdomainsortkey
Sort::Key.
Copyright (C) 2014 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.18.2 or, at your option, any later version of Perl 5 you may have available.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Fandiño'. Assuming UTF-8
To install Sort::Key::Domain, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sort::Key::Domain
CPAN shell
perl -MCPAN -e shell install Sort::Key::Domain
For more information on module installation, please visit the detailed CPAN module installation guide.