I remember I have installed Perl::Rename, by using cpan -i File::Rename, and indeed I have $HOME/perl5/bin with rename and unsafe-rename executables there.
But when I try to use rename,
# Expected: Renames FooBar.txt to Foo_Bar.txt
# It worked for me in the past
rename 's/\s/_/' *.txt
...there is an error:
Can't locate File/Rename.pm in @INC (you may need to install the File::Rename module) (@INC contains: /Library/Perl/5.34/darwin-thread-multi-2level /Library/Perl/5.34 /Network/Library/Perl/5.34/darwin-thread-multi-2level /Network/Library/Perl/5.34 /Library/Perl/Updates/5.34.1 /System/Library/Perl/5.34/darwin-thread-multi-2level /System/Library/Perl/5.34 /System/Library/Perl/Extras/5.34/darwin-thread-multi-2level /System/Library/Perl/Extras/5.34) at ./rename line 4.
BEGIN failed--compilation aborted at ./rename line 4.
Then I tried to reinstall File::Rename, by using the same command, but then there is another error message, a very long one. Here is a part from the very end:
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Can't create '/Library/Perl/5.34/File'
mkdir /Library/Perl/5.34/File: Permission denied at /System/Library/Perl/5.34/ExtUtils/Install.pm line 470.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
at -e line 1.
make: *** [pure_site_install] Error 13
RMBARKER/File-Rename-2.02.tar.gz
/usr/bin/make install -- NOT OK
What is goind on here?..
Perl itself is the one that is supplied with macOS. I didn't istall it.
$PERL, like$PERL5LIB,$PERL_LOCAL_LIB_ROOT, or$PERL_MM_OPT?cpanadded there to adjust$PATH- this is probably the very reason why the variables are emtpy currently.