Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Perl module installing at server

by james786 (Initiate)
on Aug 19, 2013 at 06:24 UTC ( #1049977=perlquestion: print w/replies, xml ) Need Help??
james786 has asked for the wisdom of the Perl Monks concerning the following question:

I developed an application in my final project using PERL. Now, I am trying to make it available online. I buy hosting for this. I installed multiple modules such as module named “String”. Then write simple lines of code:

#!/usr/bin/perl -w print "Content-type: text/html\r\n\r\n"; use strict; use warnings; use CGI ':standard'; use CGI::Carp 'fatalsToBrowser'; use String; print "done";

then it shows the error:

Can't locate in @INC (@INC contains: /usr/local/cpanel /usr +/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib/x86_64-linux-6 +4int /usr/local/cpanel/3rdparty/perl/514/lib64/perl5/cpanel_lib /usr/ +local/cpanel/3rdparty/perl/514/lib64/perl5/5.14.3/x86_64-linux-64int +/usr/local/cpanel/3rdparty/perl/514/lib64/perl5/5.14.3 /opt/cpanel/pe +rl5/514/site_lib/x86_64-linux-64int /opt/cpanel/perl5/514/site_lib .) + at index.cgi line 10. BEGIN failed--compilation aborted at index.cgi line 10.

Please help me what to do with this?

Replies are listed 'Best First'.
Re: Perl module installing at server
by kcott (Chancellor) on Aug 19, 2013 at 07:39 UTC

    G'day james786,

    Welcome to the monastery.

    It sounds like you could have more than one version of Perl installed. It's /usr/bin/perl that can't find; do you have another /some/path/to/perl on your system?

    Try running:

    which perl

    from the command-line. Does that show /usr/bin/perl or something else?

    How did you install String? There's normally some messages indicating where a module's files are being installed to. Do you have a log or history of that? Try using find to locate the path to

    Try running:

    /usr/bin/perl -e 'use String; print "$String::VERSION\n";'

    from the command-line. Do you get the same messages? Is the output showing the same version you installed? Do you get the same results with these:

    perl -e 'use String; print "$String::VERSION\n";' /some/path/to/perl -e 'use String; print "$String::VERSION\n";'

    How are you running your web application? Perhaps there's a configuration issue; have you checked this?

    Did you undertake any troubleshooting yourself before posting here. If so, what were the results?

    -- Ken

      Sir, I am doing all this within cPanel of web server. Path to PERL is /usr/bin/perl

      which is given by the service provider. Perl version is 5.14.3. I don't know how many installed version they have at their server. is at, locate by using find option


      I am not running the web application. First I am trying to installing PERL modules. After that I will run my application. And currently, I do not have access to command line. Yes, its the configuration problem but don't know its solution.

        What would XML/SAX/PurePerl/Reader/ have to do with a module named String?
Re: Perl module installing at server
by ww (Archbishop) on Aug 19, 2013 at 11:35 UTC

    We really need to know what it is that you're trying to use. Your indication that it is /perl/usr/local/cpanel/3rdparty/perl/514/site_lib/XML/SAX/PurePerl/Reader/ is reasonable enough, but not supported by anything other than the fact you found it with find. So the question is, is that the you think you're trying to use? Are you dealing with XML?

    If I've misconstrued your question or the logic needed to answer it, I offer my apologies to all those electrons which were inconvenienced by the creation of this post.
Re: Perl module installing at server
by Skeeve (Vicar) on Aug 19, 2013 at 07:16 UTC

    Maybe this helps? Yes, even you can use CPAN?

Re: Perl module installing at server
by sundialsvc4 (Abbot) on Aug 19, 2013 at 12:51 UTC

    This error-message is not saying that it can’t find Perl, nor anything about whether-or-not there is more than one Perl interpreter.   It is saying that you have somewhere tried to use String; but cannot be found in any of the places which Perl knows to look for it ... the so-called @INC list (see perlfaq8 and other such places).

    The “path to Perl” setting won’t be useful.   What you need to specify is the include-path; the so-called PERL5LIB environment-variable content.

    But first ... my Spidey Sense™ is going-off here.   You said that you are just using a vendor-supplied control panel.   Apparently, String is not a pre-installed module at your hosting company ... did you intend to install it; do you know how, if you did not?   I ask this simply for clarification.   Tell us more about where you’re coming from, and we can then more specifically help you.

    No, upon re-reading, I see that you did install the modules.   Let’s presume for simplicity that it worked.   In this case, you can either arrange by some means to define the PERL5LIB environment variable, or, as I prefer to do, write a short “stub” script which issues a use lib statement and then invokes the “real” main-program.   This causes the known-good search path to be added to the front of @INC so that the modules can subsequently be found.

    use lib whatever... ; real_main_program();

      ... as I prefer to do, write a short “stub” script which issues a use lib statement and then invokes the “real” main-program.

      I'm not sure this advice is helpful at all. In truth, I think your choice of words is prone to confuse more than illuminate. The OP clearly knows how to use use; why imply wrapping a program in another program with the terms "stub" and "invoke" and "real"?

        Your point is well taken.   What I mean to say is that (especially in a shared-hosting situation) it is often convenient to execute a very-short program whose sole purpose is to execute a use lib statement (to push paths onto @INC), then call the original main-program.   The other way to do it is to somehow ensure a correct value for PERL5LIB but I tend to like this way better.

        It has also been a real bone of contention for me that lots of hosting-services pay a great deal attention to PHP but run truly-antique versions of Perl ... and also place sometimes-too-severe resource limit restrictions.   You have to shop carefully.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1049977]
Approved by Skeeve
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2018-01-21 00:35 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (227 votes). Check out past polls.