For Linux, a simple command-line invocation will suffice, I'm sure. The same is true on Mac. These are relatively easy to find (I've found them before), so I turned my attention to the Windows case. I should stop distracting myself, but before I get back to real work, I wanted to post my findings.
The simplest approach that I could find is to wrap this small code example<http://msdn.microsoft.com/en-us/library/ms682621%28VS.85%29.aspx>into an XS module. It enumerates all "modules" (which I assume are DLLs) for a currently running process. It could be shipped with PAR::Packer, compiled only for windows, and wrapped into an OS-independent abstraction that gives useful information. To use this code, though, one would have to actually run the code with perl -c. I could envision calling this as: my $dlls = `perl -c -MPAR::Win32::DLLLister $module_name`; By compiling the list of DLLs at module invocation and comparing to the list of DLLs in an END block, we could easily print the DLLs loaded by the module. If anybody wants to dig deeper, there are two interesting<http://msdn.microsoft.com/en-us/magazine/cc301805.aspx> articles <http://msdn.microsoft.com/en-us/magazine/cc301808.aspx> about the PE File format. Anybody who is particularly gung-ho on this idea could probably write a pure Perl module that could load a .dll or .exe file as a binary string and unpack() the various headers. An almost equally ambitious approach would be to extract the interface in PEDump.exe<http://archive.msdn.microsoft.com/mag200202Windows/Release/ProjectReleases.aspx?ReleaseId=1908>(which has a license that allows redistribution) and wrap an XS module for it. Both of these are beyond my inclination. David On Wed, Aug 7, 2013 at 7:21 AM, Roderich Schupp < roderich.sch...@googlemail.com> wrote: > Thanks for the pointers to ListDlls and other stuff. > > But any solution for "check a DLL for other DLLs it references" that would > be acceptable for PAR::Packer would have to restrict itself to use > only stuff that is already present on the platform or whose existence > may be inferred from the fact that PAR::Packer was buildable on this > machine (e.g. C compiler + related toolchain stuff). > > On Windows that would mean something that comes with VisualStudio > (if you used that to build PAR::Packer) or with the MingW toolchain > (e.g. that comes with Strawberry Perl or can be installed on > ActivePerl with the "mingw" pseudo PPM). > > Cheers, Roderich > > -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." -- Brian Kernighan