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

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

update: d'oh! Another reminder not to post before first coffee of the day; my example below will not work in OPs case, as the modules are not yet on the CPAN :) Works well for those that are though.../update

Here's a modified version of a script I wrote that allows me to see if I have any of my distributions on the CPAN where I need to do required module version bumps in my Makefile.PLs for the required modules where I'm the author (original is here). It uses MetaCPAN::Client to do the hard work. Given a module name, it prints out its dependencies, as well as the reverse dependencies (which other modules use it. In CPAN speak, that's "upriver").

In this case, the module is hardcoded for the example, but pretty trivial to make it an argument.

use warnings; use strict; use MetaCPAN::Client; my $c = MetaCPAN::Client->new; my $dist = 'Mock::Sub'; check_deps($dist); rev_deps($dist); sub check_deps { my $dist = shift; $dist =~ s/::/-/g; my $release = $c->release($dist); my $deps = $release->{data}{dependency}; print "Dependencies:\n\n"; print "$_->{module}\n" for @$deps; } sub rev_deps { my $dist = shift; $dist =~ s/-/::/g; my @revdeps; my $rs = $c->rev_deps($dist); while (my $release = $rs->next){ push @revdeps, $release->distribution; } print "\nReverse Dependencies:\n\n"; for (@revdeps){ s/-/::/g; print "$_\n"; } }

Output:

Dependencies: perl Carp Scalar::Util Test::More ExtUtils::MakeMaker Reverse Dependencies: Devel::Examine::Subs File::Edit::Portable RPi::DigiPot::MCP4XXXX Test::BrewBuild App::RPi::EnvUI Devel::Trace::Subs PSGI::Hector

In reply to Re: Finding what modules use and what uses the modules by stevieb
in thread Finding what modules use and what uses the modules by Lady_Aleena

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others avoiding work at the Monastery: (4)
    As of 2019-09-21 19:48 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      The room is dark, and your next move is ...












      Results (273 votes). Check out past polls.

      Notices?