I'm a bit late to the TIMTOWTDI party, but here's my contribution: Module::Load::Conditional's check_install with Data::Dumper (both are core modules):

use Module::Load::Conditional qw/check_install/; use Data::Dumper; print Dumper( check_install( module => 'Some::Module' ) );
So how do these things work? Does every server have every Perl package ever written residing on it?

No, but: Perl comes with a set of "core" modules, as the other Monks have mentioned. Some OS distributions actually strip out some of these core modules, but in my experience on web servers, that's rare - so you can almost always rely on these core modules being available. In addition, many distributions of *NIX OSes will include a bunch more Perl modules, those required by the other packages installed on the machine. (Or, in the case of Windows, pre-packaged Perl distributions like Strawberry Perl will include a bunch of modules often needed by users - example.)

In the case of *NIX OSes, this initial set of modules will usually be installed via the system's package manager, like apt or yum. System administrators then have the option of installing additional modules either via the package manager or via tools like cpan or cpanm (although using those to install modules into the system Perl is not something I'd recommend, but that's a topic for another post). System admins also have the option of installing whole different versions of Perl, in case their users need them. For example, Pair, which hosts this site, provides at least 5.10.1, 5.12.2, 5.14.1, 5.16.2, and 5.22.1 and a ton of pre-installed modules, most likely based on popular demand by users (Update: I should also mention that typically each Perl installation will get its own independent set of directories into which it installs its modules). Installing modules into those custom-built Perls is then usually done via the aforementioned cpan/cpanm tools.

Or if the unusual::unique module is not on the server, how would anyone request it to be so?

In the case of web servers, you can probably try submitting a support ticket, and often ISPs will consider installing additional modules system-wide if they are requested by enough users. Otherwise, if they won't do it for you, it depends a bit on what kind of access you have to the web server. If you have shell (ssh) access, there are ways to install modules into your home directory either by hand or using a tool like local::lib, so that they are available only to your user and your website. If you don't have shell access (FTP-only or whatever), things are a little more tricky - but for Perl modules that are pure-Perl, i.e. they have no C/XS components that need to be compiled on the server, often it is still possible to get them onto the server, but that's also a topic for another post.


In reply to Re: How do I know if a package is on my server? by haukex
in thread How do I know if a package is on my server? by gsd4me

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.