On Sun, May 30, 2010 at 08:58, Chaitanya Yanamadala <dr.virus.in...@gmail.com> wrote: > > Hai > i am looking for some code which will tell me what are all the dependencies > that are required for a module to get installed. the one which is done while > using the yum search in cents os.can any one help me.. snip
In general, you shouldn't have to worry about dependencies. Use a tool like [cpan][1], [cpanp][2], or [cpanm][3] (all of which process dependencies, download modules, and compile, test, and install them) to install modules. I currently use cpanm to install modules into my current directory. It is easy to install: wget -O- http://cpanmin.us | perl - App::cpanminus and use: cpanm Some::Module If you want to find the dependencies programmatically for some reason, take a look at how cpanm does it, or use [CPAN::FindDependencies][4]: #!/usr/bin/perl use strict; use warnings; use CPAN::FindDependencies; for my $dep (CPAN::FindDependencies::finddeps("Moose")) { print $dep->name, "\n"; } N.B. All of the above methods use the latest versions of the modules (not necessarily what will be in a given version of CentOS) and depend on the modules accurately stating their dependencies, which is not always the case (for instance, Clipboard requires IO::All, but, the last time I installed Clipboard, IO::All was not in the dependency list causing a test error). All of them also require you to have network access to a CPAN mirror (possibly a local mirror you have set up). [1] : http://perldoc.perl.org/cpan.html [2] : http://perldoc.perl.org/cpanp.html [3] : http://search.cpan.org/dist/App-cpanminus/lib/App/cpanminus.pm [4] : http://search.cpan.org/dist/CPAN-FindDependencies/lib/CPAN/FindDependencies.pm -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/