soso_ynak has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

I'm trying to run a perl script on localhost using Hiawatha server on Linux Puppy (ubuntu based).

However, I'm getting the following error.

(The same script can be executed without any problems on the rental server and xampp on Windows.)

Contents of error.log:

127.0.0.1|Wed dd Sep 2024 hh:mm:ss +0900|/root/Web-Server/....../targe +t.cgi|Can't locate version.pm in @INC (you may need to install the ve +rsion module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-g +nu/perl/5.30.0 /usr/local/share/perl/5.30.0 /usr/lib/x86_64-linux-gnu +/perl5/5.30 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.30 /usr +/share/perl/5.30 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/p +erl-base) at /usr/lib/x86_64-linux-gnu/perl5/5.30/Storable.pm line 3.|BEGIN failed- +-compilation aborted at /usr/lib/x86_64-linux-gnu/perl5/5.30/Storable +.pm line 3.|Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl5/5.30/Encode.pm line 56.|BEGIN failed-- +compilation aborted at /usr/lib/x86_64-linux-gnu/perl5/5.30/Encode.pm + line 56.|Compilation failed in require at /root/Web-Server/....../memory.cgi line 6.|BEGIN failed--compil ation +aborted at /root/Web-Server/....../target.cgi line 6. 127.0.0.1|Wed dd Sep 2024 hh:mm:ss +0900|no output

Note: that if I run

root# find `perl -e 'print "@INC"'` -name '*.pm' -print

it will return

/usr/lib/x86_64-linux-gnu/perl5/5.30/Version.pm

so I think version.pm is already installed.

Additional information:

The 6th line of target.cgi is

use Encode;

Replies are listed 'Best First'.
Re: version error
by choroba (Cardinal) on Sep 04, 2024 at 11:00 UTC
    Note that "Version" and "version" are not the same: Perl is case sensitive. version is a core module, it should be always available, unless your Perl installation is crippled.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
      Adding to that, there should *not* be a Version.pm with capital V. It would conflict with version.pm on Windows, so that module name should not be used. Is there a chance something uppercased the filename by accident?
        I don't know if the situation was fixed on Windows in the meantime, but to use a module with wrong case leads to annoying errors, if require works but ->import fails

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        see Wikisyntax for the Monastery