in reply to Compilation failed in require at C:/mychoo/cg

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.

Replies are listed 'Best First'.
Re^2: Compilation failed in require at C:/mychoo/cg
by bliako (Abbot) on Jun 22, 2019 at 10:54 UTC

    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!!!

        "now have an error notice missing image/magick.pm which I believe should be in strawberry."

        It isn't. Familiarise yourself with the Strawberry Perl distribution. Perhaps if you explain your migration there may be more hints available, however it's usually just a case of installing the modules upon which your code depends.

        "Would have this fixed the problem with strawberry?"

        You've yet to post an actual problem with Strawberry perl. It just doesn't come with the things you believe it does.

        To install missing modules open a command prompt and type:

        cpanm Module::Name

        Substituting Module::Name for the name of the module you actually wish to install.

        yep, keep adding those wagons to the engine till the passengers come home :) cool site!