Error.pm
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Why do I get this module error: “Can't locate Error.pm in @INC”? up vote 3 down vote favorite 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? perl module share|improve this question edited Jul 22 '10 at 3:24 toolic 30.5k43468 asked Jul 21 '10 at 20:41 chuck taylor 1,02721735 1 Sounds like your cpanplus was misconfigured, so it installed libraries in the wrong place. –Ether Jul 21 '10 at 21:21 4 Answerers on crack again today; the question clearly asks about Error and everyone talks about the irrelevant CPANPLUS::Error. chuck, you just have to install this missing module before you can use it. See stackoverflow.com/questions/65865/… –daxim Jul 22 '10 at 7:55 This worked for me. Thanks daxim. –chuck taylor Jul 22 '10 at 13:46 add a comment| 4 Answers 4 active oldest votes up vote 3 down vote 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 recomm
exceptions of a certain class http://stackoverflow.com/questions/3303641/why-do-i-get-this-module-error-cant-locate-error-pm-in-inc explicitly, and differentiate between several types of exceptions. Error.pm provides a lot of syntactic sugar that tends to break easily. As http://www.shlomifish.org/lecture/Perl/Newbies/lecture4/exceptions/error.pm.html such, its use is not too recommended. On the other side, there's the Exception-Class module which provides object-oriented exceptions with no special syntactic sugar, and which works very well. Its use is highly recommended. Throwing objects which are associated with classes is a good way to be able to handle one's exceptions programatically . Contents Up Prev Next Written by Shlomi Fish
Q&A Tutorials Poetry RecentThreads NewestNodes Donate What'sNew on Aug 20, 2003 at 12:44UTC ( #285172=perlquestion: print w/replies, xml ) Need Help?? hotshot has asked for http://www.perlmonks.org/?node_id=285172 the wisdom of the Perl Monks concerning the following question: Hello guys! In relate to a previouse node I posted here I'm using Error::Simple or at least trying to use it. When I didn't wrote expilictly use Error::Simple I could catch Error::Simple exceptions, as follows:try { throw Error::Simple('A simple error'); } catch Error::Simple with { # handle Error } [download] Now, When I need to explicitly use Error::Simple, I get an error message that Error/Simple.pm can't be found in @INC. I guess it didn't came with perl-Error-0.15-1.i386.rpm I installed yesterday (downloaded using cpan2rpm). Anyhow I tried downloading Error::Simple using cpan2rpm and it couldn't be found in CPAN, anyone know where can I find it, or I must install it through perl -MCPAN -eshell Thanks Hotshot edited by ybiC: retitle from "Error::Simple"Comment on use Error::Simple - can't be found in @INCDownload Code Replies are listed 'Best First'. Re: Error::Simple by broquaint (Abbot) on Aug 20, 2003 at 12:49UTC Because Error::Simple is defined within Error.pm you just need to do use Error; [download] and you can be along your merry way e.g use Error ':try'; try { throw Error::Simple("Holy Smokes!"); } catch Error::Simple with { warn "ack - $_[0]"; }; __output__ ack - Holy Smokes! at - line 5. [download] HTH _________broquaint[reply][d/l][select] Re: Re: Error::Simple by hotshot (Prior) on Aug 20, 2003 at 12:56UTC Sorry, my fault, I didn't mention that I have:use Error ':try'; [download] In my code (didn't put it in the example), and it's still displays the same error. I will also add that I