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

Continuing with my problems in trying to get a perl script to work on localhost.

I have given up on mod_perl and am using a direct link to my strawberry in the shingig or whatever it's called.

So I did get my test.pl script to work after manually changing some things in apache and changing the shindig.

Now I am trying to get my auction site to work on localhost so I can work on it locally. It is choochooauctions.com. (Hope it is allowed to mention this. I'm not spamming just showing what I'm trying to get to work on localhost.)

I was getting an error for missing a .pm file which I think I finally fixed. Now I am getting a compilation fail message in the error log. I googled this and the closest solution I could find was possibly a missing LWF file. I found LWF files in the perl bin directory. The exact error is: AH01215: Compilation failed in require at C:/mychoo/cgi-bin/main.pl line 21.\r: C:/mychoo/cgi-bin/main.pl

Possibly this comes back to the fact that I have only changed the shindig in the main.pl file. There are many more perl files in the program. Not sure. I knew this was going to be a bear to get through.

Any thoughts? Thanks again!!!

  • Comment on Compilation failed in require at C:/mychoo/cg

Replies are listed 'Best First'.
Re: Compilation failed in require at C:/mychoo/cg
by haukex (Archbishop) on Jun 21, 2019 at 22:27 UTC
    Possibly this comes back to the fact that I have only changed the shindig in the main.pl file.

    Only the CGI script that is being run by the web server needs the correct shebang line, any files included via e.g. use or require don't need it.

    The exact error is: AH01215: Compilation failed in require at C:/mychoo/cgi-bin/main.pl line 21.\r: C:/mychoo/cgi-bin/main.pl

    Is that really all to the message? Check the server's error log, it should also be telling you why compilation failed. What's on line 21 of main.pl? Is it maybe require "somefile.pl";? If so, have you tried running perl -c somefile.pl on the command line?

    You might benefit from adding use CGI::Carp qw/fatalsToBrowser/; near the top of main.pl, after the shebang but before any code. See also CGI Help Guide and Troubleshooting Perl CGI scripts.

      and if it's a case of can't find the require/use Perl script or module mentioned in line 21, then try adding the path to the folder the missing script resides in, to the list of INClude folders using use lib 'path/to/missing/script'; at the beginning of your script, prior to require/use statements. See lib. Note you add the folder the script resides in and not a filename. Alternatively require/use with full path to the script, e.g. require '/abc/xyz/somefile.pl'

        OK I now have an error notice missing image/magick.pm which I believe should be in strawberry. I skipped the mod_perl due to having problems with loading it. Would have this fixed the problem with strawberry? Still very confused but I am now thinking that I am going to keep getting these errors until I get the modules loaded somehow??? Thanks again for any help. I have learned a lot, but need to learn a whole lot more!!!