Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    CPAN::Dependency 0.15

    Download button

    No screenshots available
    Downloads: 299  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Sebastien Aperghis-Tramoni | More programs
    Perl Artistic License / FREE
    August 19th, 2009, 23:52 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    CPAN::Dependency description

    Analyzes CPAN modules and generates their dependency tree

    CPAN::Dependency is a Perl module that can process a set of distributions, up to the whole CPAN, and extract the dependency relations between these distributions. Alternatively, it can load the prerequisites information from a CPANTS database.

    It also calculates a score for each distribution based on the number of times it appears in the prerequisites of other distributions. The algorithm is described in more details in "SCORE CALCULATION".

    CPAN::Dependency stores the data in an internal structure which can be saved and loaded using save_deps_tree() and load_deps_tree(). The structure looks like this:

     DEPS_TREE = {
     DIST => {
     author => STRING,
     cpanid => STRING,
     score => NUMBER,
     prereqs => {
     DIST => BOOLEAN,
     ...
     },
     used_by => {
     DIST => BOOLEAN,
     ...
     },
     },
     ....
     }


    With each distribution name DIST are associated the following fields:

     * author is a string which contains the name of the author who wrote (or last released) this distribution;
     * cpanid is a string which contains the CPAN ID of the author who wrote (or last released) this distribution;
     * score is a number which represents the score of the distribution;
     * prereqs is a hashref which represents the prerequisites of the distribution; each key is a prerequisite name and its value is a boolean which is true when the distribution and the prerequisite are not from the same author;
     * used_by is a hashref which represents the distributions which use this particular distribution; each key is a distribution name and its value is a boolean which is true when both distributions are not from the same author.

    SYNOPSIS

    Find and print the 10 most required CPAN distributions by stand-alone processing.

     use CPAN::Dependency;

     my $cpandep = CPAN::Dependency->new(process => ALL_CPAN);
     $cpandep->run; # this may take some time..
     $cpandep->calculate_score;

     my %score = $cpandep->score_by_dists;
     my @dists = sort { $score{$b} $score{$a} } keys %score;
     print "Top 10 modules
    ";
     for my $dist (@dists[0..9]) {
     printf "] %s
    ", $score{$dist}, $dist;
     }

    Same thing, but this time by loading the prerequisites information from the CPANTS database.

     use CPAN::Dependency;
     my $cpandep = new CPAN::Dependency;
     $cpandep->load_cpants_db(file => 'cpants.db');
     $cpandep->calculate_score;

     my %score = $cpandep->score_by_dists;
     my @dists = sort { $score{$b} $score{$a} } keys %score;
     print "Top 10 modules
    ";
     for my $dist (@dists[0..9]) {
     printf "] %s
    ", $score{$dist}, $dist;
     }



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    CPAN modules | dependency tree | Perl module | Perl | CPAN | dependency

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM