Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do I get this module error: "Can't locate Error.pm in @INC"?

Tags:

module

perl

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?

like image 658
chuck taylor Avatar asked Sep 16 '25 23:09

chuck taylor


2 Answers

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.

like image 136
Toto Avatar answered Sep 20 '25 23:09

Toto


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.

like image 32
Alexandr Ciornii Avatar answered Sep 20 '25 21:09

Alexandr Ciornii