Professional Web Applications Themes

[RFC] Devel::Dependencies - PERL Modules

Hello, after reading my article "A Timely Start" ([url]http://www.perl.com/pub/a/2005/12/21/a_timely_start.html[/url]) some people have expressed the wish to see the Devel::Depencencies module make it to CPAN. The module helps you find what all the modules a perl file (program or module) loads via the 'use' directive. It also gives an approximation of how many directory lookup this implies; this may help you troubleshoot slow program startup times. For example, given a small program ftp.pl that just contains "use Net::FTP", you can find out what modules it loads with: $ perl -c -MDevel::Dependencies=origin ftp.pl Devel::Dependencies 23 dependencies: /build/LIB/UTILS!11.151/ftpstuff/Net/libnet.cfg /build/LIB/UTILS!11.151/ftpstuff/Net/libnet.cfg (6) Carp.pm /build/LIB/PERL!5.6.1.1.39/lib/Carp.pm (38) ...

  1. #1

    Default [RFC] Devel::Dependencies

    Hello,

    after reading my article "A Timely Start"
    ([url]http://www.perl.com/pub/a/2005/12/21/a_timely_start.html[/url]) some people
    have expressed the wish to see the Devel::Depencencies module make it
    to CPAN.

    The module helps you find what all the modules a perl file (program or
    module) loads via the 'use' directive. It also gives an approximation
    of how many directory lookup this implies; this may help you
    troubleshoot slow program startup times.

    For example, given a small program ftp.pl that just contains "use
    Net::FTP", you can find out what modules it loads with:

    $ perl -c -MDevel::Dependencies=origin ftp.pl
    Devel::Dependencies 23 dependencies:
    /build/LIB/UTILS!11.151/ftpstuff/Net/libnet.cfg
    /build/LIB/UTILS!11.151/ftpstuff/Net/libnet.cfg (6)
    Carp.pm /build/LIB/PERL!5.6.1.1.39/lib/Carp.pm (38)
    Config.pm /build/LIB/PERL!5.6.1.1.39/lib/PA-RISC2.0/Config.pm (37)
    Errno.pm /build/LIB/PERL!5.6.1.1.39/lib/PA-RISC2.0/Errno.pm (37)
    Exporter.pm /build/LIB/PERL!5.6.1.1.39/lib/Exporter.pm (38)
    Exporter/Heavy.pm /build/LIB/PERL!5.6.1.1.39/lib/Exporter/Heavy.pm
    (38)
    IO.pm /build/LIB/PERL!5.6.1.1.39/lib/PA-RISC2.0/IO.pm (37)
    IO/Handle.pm /build/LIB/PERL!5.6.1.1.39/lib/PA-RISC2.0/IO/Handle.pm
    (37)
    IO/Socket.pm /build/LIB/PERL!5.6.1.1.39/lib/PA-RISC2.0/IO/Socket.pm
    (37)
    IO/Socket/INET.pm /build/LIB/PERL!5.6.1.1.39/lib/IO/Socket/INET.pm
    (38)
    IO/Socket/UNIX.pm /build/LIB/PERL!5.6.1.1.39/lib/IO/Socket/UNIX.pm
    (38)
    Net/Cmd.pm /build/LIB/UTILS!11.151/ftpstuff/Net/Cmd.pm (6)
    Net/Config.pm /build/LIB/UTILS!11.151/ftpstuff/Net/Config.pm (6)
    Net/FTP.pm /build/LIB/UTILS!11.151/ftpstuff/Net/FTP.pm (6)
    SelectSaver.pm /build/LIB/PERL!5.6.1.1.39/lib/SelectSaver.pm (38)
    Socket.pm /build/LIB/PERL!5.6.1.1.39/lib/PA-RISC2.0/Socket.pm (37)
    Symbol.pm /build/LIB/PERL!5.6.1.1.39/lib/Symbol.pm (38)
    Time/Local.pm /build/LIB/PERL!5.6.1.1.39/lib/Time/Local.pm (38)
    XSLoader.pm /build/LIB/PERL!5.6.1.1.39/lib/PA-RISC2.0/XSLoader.pm
    (37)
    strict.pm /build/LIB/PERL!5.6.1.1.39/lib/strict.pm (38)
    vars.pm /build/LIB/PERL!5.6.1.1.39/lib/vars.pm (38)
    warnings.pm /build/LIB/PERL!5.6.1.1.39/lib/warnings.pm (38)
    warnings/register.pm
    /build/LIB/PERL!5.6.1.1.39/lib/warnings/register.pm (38)
    Total directory searches: 739
    ftp.pl syntax OK

    (end of output)

    Do you find this CPANworthy? Do you think the name is well chosen?
    Thanks for your comments...
    --
    Jean-Louis Leroy
    Europerl - [url]http://www.europerl.be[/url]
    a division of Sound Object Logic - [url]http://www.soundobjectlogic.com[/url]

    Jean-Louis Leroy Guest

  2. #2

    Default Re: [RFC] Devel::Dependencies

    Jean-Louis Leroy wrote:
    > Hello,
    >
    > after reading my article "A Timely Start"
    > ([url]http://www.perl.com/pub/a/2005/12/21/a_timely_start.html[/url]) some people
    > have expressed the wish to see the Devel::Depencencies module make it
    > to CPAN.
    >
    > The module helps you find what all the modules a perl file (program or
    > module) loads via the 'use' directive. It also gives an approximation
    > of how many directory lookup this implies; this may help you
    > troubleshoot slow program startup times.
    >
    > For example, given a small program ftp.pl that just contains "use
    > Net::FTP", you can find out what modules it loads with:
    >
    > $ perl -c -MDevel::Dependencies=origin ftp.pl
    > Devel::Dependencies 23 dependencies:
    > /build/LIB/UTILS!11.151/ftpstuff/Net/libnet.cfg
    > /build/LIB/UTILS!11.151/ftpstuff/Net/libnet.cfg (6)
    > Carp.pm /build/LIB/PERL!5.6.1.1.39/lib/Carp.pm (38)
    > Config.pm /build/LIB/PERL!5.6.1.1.39/lib/PA-RISC2.0/Config.pm (37)
    > Errno.pm /build/LIB/PERL!5.6.1.1.39/lib/PA-RISC2.0/Errno.pm (37)
    <snip>
    > (end of output)
    >
    > Do you find this CPANworthy? Do you think the name is well chosen?
    > Thanks for your comments...
    I'd probably have a use for it, if only as an alternative to B::Xref.
    You won't really be able to judge how much of a market there is for it
    until you release it and people start playing with it.

    As for the name: I'd suggest Devel::ModuleDependencies, if only to make
    it clear exactly what type of dependencies it displays, though it might
    be obvious enough already. The original name is fine, though.

    regards,

    Mark
    Mark Clements Guest

  3. #3

    Default Re: [RFC] Devel::Dependencies

    Jean-Louis Leroy wrote:
    > Hello,
    >
    > after reading my article "A Timely Start"
    > ([url]http://www.perl.com/pub/a/2005/12/21/a_timely_start.html[/url]) some people
    > have expressed the wish to see the Devel::Depencencies module make it
    > to CPAN.
    >
    > The module helps you find what all the modules a perl file (program or
    > module) loads via the 'use' directive. It also gives an approximation
    > of how many directory lookup this implies; this may help you
    > troubleshoot slow program startup times.
    >
    >
    > Do you find this CPANworthy? Do you think the name is well chosen?
    > Thanks for your comments...

    Sounds interesting, though I have to say, it also sounds remarkably
    similar to Module::ScanDeps, which I have used in the past and is
    already in CPAN.

    [url]http://search.cpan.org/~autrijus/Module-ScanDeps-0.52/lib/Module/ScanDeps.pm[/url]
    thundergnat Guest

  4. #4

    Default Re: Devel::Dependencies

    > Sounds interesting, though I have to say, it also sounds remarkably
    > similar to Module::ScanDeps, which I have used in the past and is
    > already in CPAN.
    After a quick look at Module::ScanDeps, I have the impression that it
    is quite different both in intent and in implementation. My goal is to
    help troubleshoot slow loading programs by gathering information on the
    cost of loading modules in presence of long INC or PERL5LIB;
    Module::ScanDeps seems to be a tool for packaging programs.

    Also, the implementation of Module::ScanDeps is a lot more complex and
    perhaps less robust. It does look nice though, and it's good to know
    that it exists, thanks for pointing it out.
    --
    Jean-Louis Leroy
    Europerl - [url]http://www.europerl.be[/url]
    a division of Sound Object Logic - [url]http://www.soundobjectlogic.com[/url]

    Jean-Louis Leroy Guest

  5. #5

    Default Re: [RFC] Devel::Dependencies

    "Jean-Louis Leroy" <jllsoundobjectlogic.com> writes:
    > $ perl -c -MDevel::Dependencies=origin ftp.pl
    > Devel::Dependencies 23 dependencies:
    > /build/LIB/UTILS!11.151/ftpstuff/Net/libnet.cfg
    > /build/LIB/UTILS!11.151/ftpstuff/Net/libnet.cfg (6)
    > Carp.pm /build/LIB/PERL!5.6.1.1.39/lib/Carp.pm (38)
    [...]
    > Total directory searches: 739
    > ftp.pl syntax OK
    What is the meaning of (38) in the Carp line ?

    How do you compute the number of directory searches ?

    Thanks

    --
    Dominique Dumont
    "Delivering successful solutions requires giving people what they
    need, not what they want." Kurt Bittner
    Dominique Dumont Guest

Similar Threads

  1. Replies: 4
    Last Post: August 17th, 10:30 PM
  2. php source code//php-imap/ php-devel ..etc
    By Jason Wong in forum PHP Development
    Replies: 1
    Last Post: August 8th, 08:31 PM
  3. Replies: 0
    Last Post: August 5th, 04:58 AM
  4. Question about Devel::Cover
    By Himal in forum PERL Miscellaneous
    Replies: 3
    Last Post: July 11th, 12:18 PM
  5. Devel::Coverage
    By Himal in forum PERL Miscellaneous
    Replies: 3
    Last Post: July 2nd, 08:58 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139