Given a
perlbrew +
cpanm 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:
1. Gather:
perldoc -t perllocal | perl -lane'/"Module"/ && print $F[-1]' | sort -
+u >/tmp/pms
2. Switch:
perlbrew switch perl-5.42.0
+
cpanm -v </tmp/pms &>>/tmp/inst.log & tail -f /tmp/inst.log
Update:
moritz++ for the list argument reminder and
kcott++ for the logfile suggestion.
Prev. was
cat /tmp/pms | while read module ; do cpanm -v $module ; done
(yes, I prefer the useless cat :) - I like the award!)
--
perl -MLWP::Simple -e'print$_[rand(split(q.%%\n.,
get(q=http://cpan.org/misc/japh=)))]'