- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Perl Modules
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2003 05:17 AM
01-17-2003 05:17 AM
How do I find out if the following perl modules are installed on my server. Modules are:
DBI
Net-Daemon
PlRPC
Thanks and any help is greatly appreciated.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2003 05:27 AM
01-17-2003 05:27 AM
SolutionThe simple, brute force way to check that perl modules are correctly installed and loadable is to create a test script and try to use them:
#!/usr/bin/perl
use DBI;
use Net::Daemon; # I assume you want this
use PIRPC;
print "Ok\n";
or just:
perl -MDBI -MNet::Daemon -MPIRPC -e 'print "ok\n"'
I think the CPAN module may have some useful tools, and I'm sure there are more elegant ways to check. You can put the use statments in an eval { } block to trap exceptions.
-Scott-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2003 05:34 AM
01-17-2003 05:34 AM
Re: Perl Modules
the mentioned modules aren't those belonging to a usual standard installation.
Thus if they were installed "correctly", what I assume, the Perl MakeMaker module will install them under the sitelib subdir.
Though I could provide you with an ugly Perl one-liner to have Perl check if they are installed, I guess it would be easier to use a regular Unix find.
perl -V:installsitelib
will tell you the start directory from where to search.
All (CPAN) Perl modules have per convention to have filenames like
So to look for e.g. DBI.pm
find /opt/perl5/lib/site_perl -type f -name DBI.pm
On the other hand you can simply check the presence of a version No. as every CPAN module must define it.
e.g.
# perl -MDBI -e 'print "$DBI::VERSION\n"'
1.30
If it weren't installed you'd get an error message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2003 05:50 AM
01-17-2003 05:50 AM
Re: Perl Modules
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2003 05:56 AM
01-17-2003 05:56 AM
Re: Perl Modules
But I'd like to add my suspicion that the suggested eval block wouldn't work because the use statement will be executed at compile time whereas a trapping of the eval block would happen at runtime.
But you could trap a require() of the module.
e.g.
eval { require SomeModule };
if ($@) {
warn "cannot load SomeModule";
}
If the required module is used the OO way it wouldn't matter because you don't need to import any variables or functions in your namespace, but use the OO interface's accessor methods instead.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2003 06:00 AM
01-17-2003 06:00 AM
Re: Perl Modules
-e... is the script to run (each -e represents a single perl line, don't forget the ;'s)
see 'man perlrun'
If you're looking for those modules to install DBD::Oracle, note that Net::Daemon and PlRPC are optional, and perl hes to be build `Oracle-Prepared', meaning that libs should start with '-lcl -lpthread':
d3:/wrk 106 > perl -V | grep libs=
libs=-lcl -lpthread -lnsl_s -lndbm -lgdbm -ldb -lmalloc -ldld -lm -lc -lndir -lcrypt -lsec
perllibs=-lcl -lpthread -lnsl_s -lmalloc -ldld -lm -lc -lndir -lcrypt -lsec
d3:/wrk 107 >
Enjoy, have FUN! H.Merijn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2003 06:02 AM
01-17-2003 06:02 AM
Re: Perl Modules
perldoc perlrun
or
man perlrun
The -M is another way of loading a module on the interpreter's invocation instead of saying "use" in a script.
The -e tells the Perl interpreter that the next string on the command line that follows is the script to be interpreted
(similar to grep, sed, awk)