There's more than one way to do things | |
PerlMonks |
Re: How do I know if a package is on my server?by shmem (Chancellor) |
on Aug 26, 2017 at 12:41 UTC ( [id://1198060]=note: print w/replies, xml ) | Need Help?? |
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:
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
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.
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
In Section
Seekers of Perl Wisdom
|
|