Chas. Owens wrote:
On Feb 18, 2008 6:57 PM, John W. Krahn <[EMAIL PROTECTED]> wrote:
Mark Wagner wrote:
Is there any easy way to get a list of all modules loaded by a Perl script?

$ perl -le' use Time::Local; print for keys %INC '

Of course, this assumes the author did not do anything like

eval "use SomeModule" if $ENV{USE_SOMEMODULE};

or the sort of tricks that the DBI and other factory classes use.

What would be the problem with that?

$ perl -le 'eval "use Time::Local"; print for keys %INC'
vars.pm
Carp.pm
Exporter.pm
warnings.pm
Config.pm
Time/Local.pm
strict.pm
integer.pm
warnings/register.pm
$

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to