[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

RE: [MacPerl] Howto import modules into runtimes?



At 5.12 97/4/23, Bob Wilkinson wrote:
>      I don't know a way to do this directly - however, you could write a Perl
>program to statically analyse your "use" chain. This would be a recursive
>routine such that when a "use" statement is encountered, that "use'd" module
>is inspected, for any "use's" within. This process is carried out until a
>module
>which has no dependencies is encountered, then the dependency tree is climbed.
>A list would then be constructed. This technique is similar conceptually
>to traversing a hierarchical directory structure (and dropping down a level
>when a sub-directory is encountered).
>
>      If this isn't clear please mail me. If anyone does know a better way
>to check the modules a running MacPerl program is using, please advise.

Yessir ...

#!perl
use Mac::AppleEvents;
foreach (keys %INC) {print "$_\n"}

FYI, the value for each key ($INC{$_}) is the full pathname for the module.
%INC contains all files that are use'd, require'd, do'd, or whatever.  The
above two-line script reveals a list of 14 files.

#================================================================
Chris Nandor                                      pudge@pobox.com
PGP Key 1024/B76E72AD                           http://pudge.net/
Keyfingerprint = 08 24 09 0B CE 73 CA 10  1F F7 7F 13 81 80 B6 B6



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch