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

customize cpan autobundle

by GoCool (Scribe)
on Mar 10, 2005 at 22:33 UTC ( #438451=perlquestion: print w/ replies, xml ) Need Help??
GoCool has asked for the wisdom of the Perl Monks concerning the following question:

Is there some way to customize the Snapshot.pm file created by cpan's autobundle so that i can remove some of the packages that i don't need, before reinstalling the bundle for a newer version of perl? Thanks Gokul

Comment on customize cpan autobundle
Re: customize cpan autobundle
by rnahi (Curate) on Mar 10, 2005 at 23:06 UTC

    Snapshot.pm is just a text file with a list of modules inside. Now, Perl happens to be a tool that was created with text manipulation in mind. Therefore, why don't you use it as a filter?

    The quick way:

    $ perl -i.bak -ne 'print unless /(?:Module1|Module2)/' Snapshot.pm

    The classic way:

    #filter_snapshot.pl use strict; use warnings; my @exclude_modules = map {chomp;quotemeta($_)} <DATA>; FILTER: while (<>) { for my $excluded (@exclude_modules) { next FILTER if /$excluded/ } print ; } __DATA__ module1 Module2 Module3::SubModule Module4

    Invoke it as

    $ perl filter_snapshot.pl Snapshot.pm > New_Snapshot.pm
      An even more quick/classic way: use a text editor :-)
Re: customize cpan autobundle
by dragonchild (Archbishop) on Mar 11, 2005 at 13:26 UTC
    You could also build a completely new install first, then autobundle it.

    Here's why I'm suggesting that - it's better to test out any applications depending on that autobundle first. The best way I've found to build an autobundle is to install the base, then run your stuff. You're probably missing a module, so you install it. Keep running your test suite (you have one, right?) and installing missing dependencies until your suite runs. Then, autobundle and go home. :-)

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.


      "Here's why I'm suggesting that - it's better to test out any applications depending on that autobundle first. The best way I've found to build an autobundle is to install the base, then run your stuff. You're probably missing a module, so you install it."
      But i won't be missing a module in Perl v5.8.6 if that module is already installed in v5.6.1 (i have both version of perl installed) AND if that module does NOT have XS/C extension, right?
        Different @INC's. You can copy one to another, but they're not considered the same. Reason being is that even PurePerl can have Perl version dependencies. For example, PDF::Template installs differently depending on if you're using 5.8+ vs. pre-5.8.

        Being right, does not endow the right to be rude; politeness costs nothing.
        Being unknowing, is not the same as being stupid.
        Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
        Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://438451]
Approved by moot
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (10)
As of 2014-09-03 08:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (35 votes), past polls