Velocity Reviews

Velocity Reviews (
-   Perl Misc (
-   -   Which Perl files (other than modules) are used by a script? (

Jonathan Gowland 09-13-2003 11:44 AM

Which Perl files (other than modules) are used by a script?
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/ 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?

All times are GMT. The time now is 04:55 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.