develooper Front page | perl.perl5.porters | Postings from February 2013

Re: Keeping track of used modules (Was: Perl 7 or Perl 2013?)

Thread Previous | Thread Next
From:
David Golden
Date:
February 13, 2013 15:52
Subject:
Re: Keeping track of used modules (Was: Perl 7 or Perl 2013?)
Message ID:
CAOeq1c_+ZvUHFTrk=Ar2KitpuNF3aYTgarcGA9oAy6hSyhNWRg@mail.gmail.com
On Wed, Feb 13, 2013 at 1:53 AM, Greg Lindahl <greg@blekko.com> wrote:
> In addition to using END (for short-lived scripts) I'll just have the
> daemons report daily, sweep everything up, et voila! A little cleaning
> of the data, and I'd be happy to make it public.

If you don't want to rely on END, then the other way I'd go about it
would be to use an @INC hook to record things at require time.  You
have a little trickiness if things modify @INC ('use lib').  Something
that overrides CORE::GLOBAL::require would work, too, but then you
have to be sure to get the semantics of require exactly right.  (I
also wonder if %INC is tie-able?)

There are plenty of such things on CPAN -- you'd have to figure out if
any serve or adapt your own.

Devel::TraceDeps
Devel::Loaded
Devel::TraceUse
etc.

David

-- 
David Golden <xdg@xdg.me>
Take back your inbox! → http://www.bunchmail.com/
Twitter/IRC: @xdg

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About