Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

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

Well, they say that good Perl programmers are lazy.   Goody for the good ones.   Fortunately, I guess that programmers like me must be lazy, too.  

#!/usr/bin/env perl use strict; use warnings; use Data::Dumper; print STDERR "Scanning ...\n"; # find dependent things ... note 'scandeps' only considers modules. # note: do not say "*.pm" here or you won't look in subdirs # replace 'path_to_my_app_libs' with whatever is correct for you ... my @output = qx{scandeps.pl /path_to_my_app_libs/*}; my @keepers; # The output of interest is the module-name, found in single quotes foreach (@output) { chomp; next unless /^'([A-Z].*?)'/; push @keepers, $1; } print STDERR "Installing ...\n"; foreach (@keepers) { # The output is a little "wordy." # Omit hundreds o' things that we know are really parts of others. next if /^Date::Manip::TZ::/; next if /^Date::Manip::Offset::/; qx{cpanm $_}; # install it } # see if we got everything ... # (failure of some of these is not necessarily awful) foreach (@keepers) { print STDERR "require $_\n"; eval "require $_"; # magic necessary voodoo ... see 'perldo +c require' } print "Normal completion.\n";

At first I was seriously flummoxed by the fact that I did not get complete results.   It turns out that it is very important that the scandeps.pl command ends with “*” and not, as originally written, “*.pm”   (The first form omits subdirectories.)

This script requires App::cpanminus (for cpanm) and Module::ScanDeps (for scandeps.pl).

As written, it still does not make any improvements to the order in which things are attempted.   I took a brief look at the hashref returned by scan_deps() and it does look like it could be used more fully, i.e. in order to do that.   (No doubt, it already has...)


In reply to Re: How to clean-up an autobundle so it's really "auto-installable" by sundialsvc4
in thread How to clean-up an autobundle so it's really "auto-installable" by sundialsvc4

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 making s'mores by the fire in the courtyard of the Monastery: (4)
    As of 2021-01-21 11:19 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Notices?