Which Perl files (other than modules) are used by a script?

J

Jonathan Gowland

I'm writing a software installer (in Perl, of course) which is
intended to run from a CD. Because it may be used on customer systems
where they don't have Perl installed (shame on them, I know, but they
pay the bills), I need to put enough of the Perl runtime environment
on the CD to allow the installer program to run. And because the
installer program is likely to be enhanced in future, with the use of
extra modules, I want to be able to generate the list of supporting
files (.pm files, shared libraries, etc.) automatically. Although I
can test (and have tested) things by temporarily renaming the
directory holding the system's Perl libraries, we support around six
different UNIX and Linux systems, so I'm after a method that can tell
me what needs to go onto the CD before I test it.

Using %INC, I can determine the list of module files nicely. To find
out which shared libraries are needed, I thought I could use
@DynaLoader::dl_modules, but on some platforms (e.g. Linux with Perl
5.6.1) this array is empty. (Any ideas?) So as a fallback, I look
under $Config{archlibexp} for any shared libraries whose name matches
a module in %INC. This seems to work for all platforms except one.
On Solaris 7 with Perl 5.005_03, when I run using the cut-down
environment, I get:

Can't locate auto/DynaLoader/dl_findfile.al in @INC (@INC contains
...

So is there a better way to determine which shared library and other
non-module files are needed by a script?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top