[Thamesvalley-pm] checking for perl modules
gmatt at nerc.ac.uk
Fri Jun 13 04:19:28 PDT 2008
Is there an easy way to run a check for perl modules at the start of a
script so that it can present a friendly/useful message to the user
along the lines of:
"This script requires the following modules which don't appear to be
installed on your system:"
rather than crashing out with something like:
Can't locate IO/Socket/SSL.pm in @INC (@INC contains: /etc/perl
/usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5
/usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8
/usr/local/lib/site_perl .) at /usr/share/perl5/Net/LDAP.pm line 970,
<STDIN> line 1.
which is pretty horrendous to the casual user.
Greg Matthews 01491 692445
Head of UNIX/Linux, iTSS Wallingford
This message (and any attachments) is for the recipient only. NERC
is subject to the Freedom of Information Act 2000 and the contents
of this email and any reply you make may be disclosed by NERC unless
it is exempt from release under the Act. Any material supplied to
NERC may be stored in an electronic records management system.
More information about the Thamesvalley-pm