CPAN::Nearest - find the nearest module to a given name.
use CPAN::Nearest 'search'; my $module = search ('02package.details.txt', 'Lingua::Stop::Wars'); # Now $module = "Lingua::StopWords";
my $close_name = search ($file, $module_name);
Search the package detail file $file for a module named $module_name and return the closest name. E.g. if you search for "Harry::Potter",
$file
$module_name
my $close_name = search ($file, 'Harry::Potter');
the value in $close_name, the closest CPAN module, is "Data::Lotter".
$close_name
The file specified by the first argument, $file in the example, is usually found at ~/.cpan/sources/modules/02packages.details.txt.gz on a Unix-like system. This may be specified as the file name. This module can read either a compressed or uncompressed version. There is a speed increase of 10-20% when an uncompressed file is used.
The distribution includes a standalone program called "nearest-module" as shown in this blog entry. To use this program, edit the file nearest-module.c in the top level of the distribution to point to the name of the file 02packages.details.txt or 02packages.details.txt.gz on your system, and compile it with
make -f makeitfile nearest-module
Ben Bullock, <bkb@cpan.org>
This package and associated files are copyright (C) 2012 Ben Bullock.
You can use, copy, modify and redistribute this package and associated files under the Perl Artistic Licence or the GNU General Public Licence.
To install CPAN::Nearest, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPAN::Nearest
CPAN shell
perl -MCPAN -e shell install CPAN::Nearest
For more information on module installation, please visit the detailed CPAN module installation guide.