Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

gnat (29)

  (email not shown publicly)

Journal of gnat (29)

Tuesday May 14, 2002
10:58 PM


[ #4929 ]
Is there a script I can run from cron that will automatically update my modules from CPAN? I know it's a security risk, but given that my modus operandi is to say:

% sudo perl -MCPAN -e shell
cpan> install Module::Foo

and I automatically follow prerequisites, I figure I'm already at the mercy of anyone who maintains the modules I already have. There's nothing preventing them from changing the Makefile.PL of their new release to drop my /etc/passwd into the mail for them, or add a new account, or even just require Nat::You've::Been::R00ted.

Why do I want this? I'm working an hour a night on the next edition of the Perl Cookbook, and I'm doing SOAP stuff. I want to test code, which means I need SOAP::Lite installed, which means I need ... and suddenly the world of dependencies is opening before me. And when I did an r in CPAN shell to see what else I should update ... aiee! Leave a machine a month and it becomes a bloody fossil!


The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • use a Bundle (Score:3, Informative)

    by hfb (74) on 2002.05.14 23:12 (#8427) Homepage Journal

    Use autobundle from the list of the modules you want up to date and then just write a cheap script to install them into a temp and non-priv location if you don't want to run it as root. See the CPAN FAQ and the docs :)

  • Easiest method is probably to use CPANPLUS and rip the code for the 'o' command ('s 'r'). That'll get you a list of modules. Then you just need to run an install for each one. Shouldn't be too hard.
      ---ict / Spoon
  • /usr/bin/perl -MCPAN -e 'CPAN::Shell->install(CPAN::Shell->r)'

    -- briac
    • C<install> is exported by default, so you can just install(CPAN::Shell->r).

      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers