For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > January 2006 > [RFC] Devel::Dependencies









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author [RFC] Devel::Dependencies
Jean-Louis Leroy

2006-01-10, 4:00 am

Hello,

after reading my article "A Timely Start"
(http://www.perl.com/pub/a/2005/12/2...mely_start.html) 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 - http://www.europerl.be
a division of Sound Object Logic - http://www.soundobjectlogic.com

Mark Clements

2006-01-10, 4:00 am

Jean-Louis Leroy wrote:
> Hello,
>
> after reading my article "A Timely Start"
> (http://www.perl.com/pub/a/2005/12/2...mely_start.html) 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
thundergnat

2006-01-10, 4:00 am

Jean-Louis Leroy wrote:
> Hello,
>
> after reading my article "A Timely Start"
> (http://www.perl.com/pub/a/2005/12/2...mely_start.html) 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.

http://search.cpan.org/~autrijus/Mo...ule/ScanDeps.pm
Dominique Dumont

2006-01-17, 6:57 pm

"Jean-Louis Leroy" <jll@soundobjectlogic.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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com