Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Is there a module which Perl has to load when using any module?

by merlyn (Sage)
on Apr 28, 2005 at 15:53 UTC ( [id://452362]=note: print w/replies, xml ) Need Help??


in reply to Re: Is there a module which Perl has to load when using any module?
in thread Is there a module which Perl has to load when using any module?

Actually, it's much simpler than that:
END { print STDERR "Modules used:\n", map { " $_\n" } values %INC; }

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on Re^2: Is there a module which Perl has to load when using any module?
  • Download Code

Replies are listed 'Best First'.
Re^3: Is there a module which Perl has to load when using any module?
by blazar (Canon) on Apr 28, 2005 at 16:09 UTC
    Indeed. Of course the original discussion was about how to monitor module loading on a "per use statement basis", as can be suggested by the minimal example supplied - still sloppily speaking here, but I guess it's easy to understand what I really mean here.

    But then again it was just an example of how to use a coderef in @INC to achieve something similar to what the OP wanted...

Re^3: Is there a module which Perl has to load when using any module?
by DaWolf (Curate) on Apr 28, 2005 at 21:08 UTC
Re^3: Is there a module which Perl has to load when using any module?
by djp (Hermit) on Apr 29, 2005 at 01:09 UTC
    Brilliant. Can I suggest sorting for readability:
    END { print STDERR "Modules used:\n", map { " $_\n" } sort values %INC; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://452362]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-25 04:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found