Can’t locate Class/ in @INC (Ubuntu)


I tried using SOAP::Lite with Perl recently and kept getting the following error on my server when trying to execute my Perl script:$ ./
Can't locate Class/ in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/ hare/perl/5.10.1/SOAP/ line 435.
BEGIN failed--compilation aborted at /usr/local/share/perl/5.10.1/SOAP/ line 435.
Compilation failed in require at ./ line 3.
BEGIN failed--compilation aborted at ./ line 3.

The solution was quite simple, although finding it on the internet was not as simple.

Just do the following to install the required class:

sudo apt-get install libclass-inspector-perl

Voila, it’s working as expected.

If you are using RHEL or CentOS, you could do the following (I did not test this but found it at this link :

yum install 'perl(Class::Inspector)'

Hope this helps someone out there!


Add a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.


  1. ilias

    Thank you very much, it helped me! i was getting this error in windows active perl and i found here what i needed to install. Thanks!

  2. Glad I could help. I’ve forgotten about this post and how much time it took me to find a solution….

  3. kumar

    But when i am running that command i received below error
    sudo: apt-get: command not found

    1. Are you running the command on Ubuntu (or another Debian based derivative of Linux) ?

      What version of Linux are you using?