in reply to How do I know if a package is on my server?
And how would I go about seeing if the package/module *is* on the server using some script?
Easy - try to use the module, if that fails, it is not there. At least it is not found in any path included in perl's built-in array @INC.
So how do these things work?
What kind of "hosting server" do you have? what kind of access? Is it a server with shell access (i.e. ssh) or a plain web server?
Perl comes with many modules included, two of them are Config and Module::CoreList. The latter can be used to list all core modules:
# command line $ perl -lE 'use Module::CoreList; say for Module::CoreList->find_modul +es' # CGI #!/usr/bin/perl use Module::CoreList; use 5.10.0; say "Content-type: text/html\n"; say <<EOH; <html><head><title>CoreList</title></head> <body><h1>Perl Core Modules:</h1> <pre> EOH say for Module::CoreList->find_modules; say "</pre></body></html>";
The Config module exports the hash %Config which holds all information about how perl was built, including paths for module inclusion search (which, again, show up in @INC). The relevant keys are
In a sane setup, the core modules root is $Config{privlib}. All vendor provided modules of the platform live in vendorlib, the modules specific for the site are in sitelib.
You can prepend an arbitrary directory to @INC using the lib module
use lib '/path/to/my/modules';
which ensures that modules are first looked for in there.
This bunch of information should be enough to enable you to answer the rest of your questions by yourself.
|
|---|