[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Mappings between CPAN packages and lib.*-perl packages

Is it correct to assume that any given debian package whose name is of
the form lib.*-perl corresponds to one and only one CPAN module, and
that the algorithm for determining the corresponding debian package name
from a given CPAN module name is this? ...

- Add a leading "lib" and a trailing "-perl" to the CPAN module name.

- Replace all occurrences of double colon ('::') with a hyphen ('-').

- Convert to lower case.

If so, then I presume that I can search for any given CPAN package
names as follows (using Perl code here):

  foreach my $cpanModuleName (@ARGV) {
    (my $debianPackageName = "lib${cpanModuleName}-perl") =~ s/::/-/g;
    system("apt-cache search --names-only '^${debianPackageName}\$'");

This little program seems to work, but are my assumptions correct?

Thanks in advance.

 Lloyd Zusman

Reply to: