Compilation Fail In require while using perl

2.8k views Asked by At

I had developed some scripts on my machine using epic & perl. But when i copied them on to other machine, I get an error message "Compilation Failed in required". How can I handle this

3

There are 3 answers

0
Harshavardhan Konakanchi On

The problem is with the DBI module version I had used. It is 1.619. If I rename the version in DBI module to 1.616 all the error messages are gone.

The error message occurs when we had not Loaded the required perl modules to PERLLIB. In EPIC, click where the error points to , navigate to the base error. For me the base error is at DBI. It didn't show any error message at DBI. check the script where the keyword require is present.

for me the error is shown at

Test -> DBTest -> DBAccess -> DBI

1
catfood On

You should be getting error messages indicating which modules weren't loaded. They're missing from your installation, so go to cpan.org or better yet just use the CPAN.pm module to load the required modules and dependencies.

1
ikegami On

That's not the relevant message. The message you are asking about is issued after getting an error compiling a module. Fix it by fixing whatever error the module encountered.

For example,

>perl -e"use Mod;"
syntax error at Mod.pm line 4, near "+;"
Compilation failed in require at -e line 1.
BEGIN failed--compilation aborted at -e line 1.

The BEGIN failed because the compilation failed, and the compilation failed because of the syntax error. Fix the syntax error and all three errors go away (unless a new error is discovered).