I tried running:
perl -e "use Error;"
from cmd in windows 7. (active perl 5.12 installed on system) and I am开发者_如何学编程 getting the error
Can't locate Error.pm in @INC (@INC contains: C:/Perl64/site/lib C:/Perl64/lib )
I manually searched and found Error.pm
in C:/Perl64/lib/CPANPLUS
.
Does anyone have an idea what could be going on here?
You have to install the module Error that can be found on CPAN. But be aware of this warning:
Using the "Error" module is no longer recommended due to the black-magical nature of its syntactic sugar, which often tends to break. Its maintainers have stopped actively writing code that uses it, and discourage people from doing so. See the "SEE ALSO" section below for better recommendations.
lib/CPANPLUS/Error.pm is a core "CPANPLUS::Error" module. It is used by CPANPLUS. If you want to use non-core "Error" module, you need to install it. Do "ppm install Error". Also, you can use similar modules Try::Tiny and TryCatch. They are non-core too, so you also would need to install them.
I'm on CentOS 7.3, and I have git-1.8.3.1-23 and perl-Error-0.17014-1 rpm packages installed and still got this error. I didn't want to mess with installing perl modules via CPAN. I figured out the path where perl-Error is installed (rpm -ql perl-Error
) and am now running git commands like so:
PERL5LIB="/usr/lib/perl5/vendor_perl/5.8.8" git add -p someFile.sh
This works fine for me. Note that the path may be different for you.
On Centos 8, you can installing perl-Error
to get this module:
sudo dnf install perl-Error
you could set PERL5LIB to prepend a directory to @INC
PERL5LIB="C:/Perl64/lib/CPANPLUS"
I forget how to set env variables permanently in windows (or if this is even the right syntax for the shell.)
also to see your @INC perl -V
精彩评论