perlmeditation
zgrim
Given a <a href="http://perlbrew.pl">perlbrew</a> + <a href="http://cpanmin.us">cpanm</a> setup (which now I can not possibly imagine my toolbox without), a quick dirty/useful way to switch perls and restore all modules in minutes - without an elaborate/proper @INC scan - is to use perllocal:
<br>
<h4>1. Gather:</h4>
<code>
perldoc -t perllocal | perl -lane'/"Module"/ && print $F[-1]' | sort -u >/tmp/pms
</code>
<h4>2. Switch:</h4>
<code>
perlbrew switch perl-5.42.0
</code>
+
<code>
cpanm -v </tmp/pms &>>/tmp/inst.log & tail -f /tmp/inst.log
</code>
<b>Update</b>: <a href="http://perlmonks.org/?node_id=616540">moritz</a>++ for the list argument reminder and <a href="http://perlmonks.org/?node_id=861371">kcott</a>++ for the logfile suggestion.
Prev. was
<i>
<code>
cat /tmp/pms | while read module ; do cpanm -v $module ; done
</code>
(yes, I prefer the useless cat :) - I like the award!)
</i>
<br/><br/>
<div class="pmsig">
--
<code>
perl -MLWP::Simple -e'print$_[rand(split(q.%%\n.,
get(q=http://cpan.org/misc/japh=)))]'
</code>
</div>