Perl error: Can't locate module in @INC

From a recent email: Help, I've just run into this Perl error: "Can't locate module in @INC".

Solution: If you get a Perl error message like "Can't locate in @INC", this message means that the Perl module you're trying to include (like the module named Foo) can't be found in Perl's include path, which is represented by the variable named @INC.

If you run into this error message, there are a couple of things that can be happening, and the following Perl blog postings I've written should help you. I've listed the posts in the order in which I think they'll help you troubleshoot your problem:

Finally, if the Perl module you need isn't already installed on your system, you're going to need to install it. I haven't written any articles on how to install a Perl module, so if you need to install one just look at this CPAN link on installing Perl modules.

Share it!

There’s just one person behind this website; if this article was helpful (or interesting), I’d appreciate it if you’d share it. Thanks, Al.


Thx for this post, i have the same problem with a perl script but all my module was installed. This problem appears some times but some times the script work fine.
Thx for help

Add new comment

The content of this field is kept private and will not be shown publicly.

Anonymous format

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul type> <ol start type> <li> <pre>
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.