tachyon has asked for the wisdom of the Perl Monks concerning the following question:

I am writing an install script at the moment and have two qestions. On Debian you can use apt-get to install perl modules so what I want to know is:

1) What exactly does perl -e 'print $^O' return on Debian?

2) Where can I find the list of apt-get packages for perl. They almsot bear a linear relation to the real module name (prefix of lib and postfix of -perl) but not quite:

$cmd = 'apt-get install libcgi-perl' if $module eq + 'CGI'; $cmd = 'apt-get install libdbi-perl' if $module eq + 'DBI'; $cmd = 'apt-get install libmail-pop3client-perl' if $module eq + 'Mail::POP3Client'; $cmd = 'apt-get install libmime-perl' if $module eq + 'MIME::Base64'; $cmd = 'apt-get install libmime-lite-perl' if $module eq + 'MIME::Lite'; $cmd = 'apt-get install libcrypt-blowfish-perl' if $module eq + 'Crypt::Blowfish'; $cmd = 'apt-get install libcrypt-cbc-perl' if $module eq + 'Crypt::CBC'; $cmd = 'apt-get install libnet-perl' if $module eq + 'Net::SMTP'; $cmd = 'apt-get install libtext-perl' if $module eq + 'Text::Wrap'; print "Trying to install $module, command line $cmd\nPlease be + patient.....\n";

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Help from Debian aficiandos
by elusion (Curate) on Dec 10, 2002 at 21:37 UTC
Re: Help from Debian aficiandos
by theorbtwo (Prior) on Dec 10, 2002 at 21:46 UTC

    I'm on the XP half of my duel-boot now, so all this stuff is IIRC, but..

    I think $^O eq 'Linux'.

    The rule, according to the approps standard (part of the perl package, IIRC), is to take the name of the "primary package", s/::/-/g, tr/A-Z/a-z/, and lib$_-perl. IE Foo::Bar becomes libfoo-bar-perl. However, in pratice, the pratice is to take the name of the CPAN distribution, and not prepend lib if the distro already begins with lib. For example, Net::SNMP is part of the libnet CPAN distro, even though there is no package Net.pm.

    One thing you could do if you want to figure out what debian package a given perl module maps on to is to do an apt-get search on the name of the module. That'll only work if the package description mentions the package. Another possiblity is to transform the package name into a filename (s|::|/|g, append .pm), and search Contents for that (either download Contents first, or use the web interface on packages.debian.org).


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

Re: Help from Debian aficiandos
by jsprat (Curate) on Dec 10, 2002 at 22:15 UTC
    Try apt-cache to get package names. "apt-cache search perl" should get you a list of all packages with the word perl in their name. Also, debian supports a url like http://packages.debian.org/*perl*. LWP and HTML::Parser should go a long way with this.

    If you are looking for an easy to use tool, synaptic is way better than dselect or aptitude.

Re: Help from Debian aficiandos
by pfaut (Priest) on Dec 10, 2002 at 21:19 UTC

    I'm not a debian user but are those kits particular to debian or could they work on any system with apt-get installed? Instead of looking for debian specifically, maybe you could just look for apt-get in the path.

Re: Help from Debian aficiandos
by hossman (Prior) on Dec 10, 2002 at 21:43 UTC

    slash:~> perl -le 'print $^O' linux

    As far as what modules are in what .debs, you should check out http://packages.debian.org. It lets you view lists of all of the packages in a specific (or all) releases of debian, view the files provided by a package, or search packages for words (or for specific files). For example, this is a search of what packages in 'stable' provide files named CGI.pm.