Re: Print out modules used during runtime?
- From: John Bokma <john@xxxxxxxxxxxxxxx>
- Date: 31 May 2006 20:21:35 GMT
"Paul Lalli" <mritty@xxxxxxxxx> wrote:
Omar Zakaria wrote:
Hello, all. I was wondering if there's a way, without downloading any
special modules, or packages, to have a perl script print out the list
of packages or modules it imported (i.e. anything I "use"'d or
"require"'d).
%INC is probably what you're looking for. It keeps a list of all
modules used/required as keys, with the values being the paths to
those modules. Note, however, that %INC will have not only the modules
your script specifically used, but also those modules used by a module
your script used:
$ perl -e' use CGI; print "$_ => $INC{$_}\n" for keys %INC;'
warnings/register.pm =>
/opt2/Perl5_8_4/lib/perl5/5.8.4/warnings/register.pm
Carp.pm => /opt2/Perl5_8_4/lib/perl5/5.8.4/Carp.pm
vars.pm => /opt2/Perl5_8_4/lib/perl5/5.8.4/vars.pm
strict.pm => /opt2/Perl5_8_4/lib/perl5/5.8.4/strict.pm
Exporter.pm => /opt2/Perl5_8_4/lib/perl5/5.8.4/Exporter.pm
constant.pm => /opt2/Perl5_8_4/lib/perl5/5.8.4/constant.pm
warnings.pm => /opt2/Perl5_8_4/lib/perl5/5.8.4/warnings.pm
CGI/Util.pm => /opt2/Perl5_8_4/lib/perl5/5.8.4/CGI/Util.pm
overload.pm => /opt2/Perl5_8_4/lib/perl5/5.8.4/overload.pm
CGI.pm => /opt2/Perl5_8_4/lib/perl5/5.8.4/CGI.pm
See perldoc perlvar for more information about %INC.
I think the problem is:
#Insert awesome perl program here
and the fact that it's an exe.
http://www.die.net/doc/linux/man/man1/strace.1.html
I am sure there is something similar for Windows (tracing which files are
opened by an exe).
--
John Bokma Freelance software developer
&
Experienced Perl programmer: http://castleamber.com/
.
- Follow-Ups:
- Re: Print out modules used during runtime?
- From: John Bokma
- Re: Print out modules used during runtime?
- References:
- Print out modules used during runtime?
- From: Omar Zakaria
- Re: Print out modules used during runtime?
- From: Paul Lalli
- Print out modules used during runtime?
- Prev by Date: Re: Print out modules used during runtime?
- Next by Date: Re: Database SQL problem....
- Previous by thread: Re: Print out modules used during runtime?
- Next by thread: Re: Print out modules used during runtime?
- Index(es):
Relevant Pages
|