I tried doing the following. First, I install a relocatable perl, e.g.:
% perlbrew -Duserelocatableinc -j4 -n --as perl-5.28.1-fresh_src 5.28.1
Then, whenever I need a new throw-away fresh installation of perl to test things out, I do:
% cp -la ~/perl5/perlbrew/perls/perl-5.28.1-fresh{_src,1}
% perlbrew switch 5.28.1-fresh1
(then would later create fresh2
, fresh3
and so on as needed; and when I want to throw these away I just rm -rf ~/perl5/perlbrew/perls/*fresh1
and so on.)
However, something (cpanm? EUMM?) is still confused. Scripts installed from CPAN still has the original perl path (in this case, /home/USER/perl5/perlbrew/perls/perl-5.28.1-fresh_src/bin
) in their shebang line.
Any hint to the problem above, or an alternative way to quickly create a fresh throw-away perl installation is appreciated. Also, would the -l
(--link
) option of cp
in the above command cause issue (other than perllocal.pod
being appended and will contain installation records of perl installations, which is fine for me)?