http://www.perlmonks.org?node_id=1054211


in reply to Error "Compilation failed in require" with "use" syntax

I get an error: "Compilation failed in require". This is the entire warning

I can't help you with eclipse , much, except to say this is surely a FAQ item (its @INC path management, its perl-faq)

One way to manage is File::FindLib or lib+FindBin

Absolute paths always work, you can even do the same thing using the shebang

#!/usr/bin/perl -I/hardcoded/paths -I/and/another --

Now to your shell attempt you've got typo

syntax error at -e line 1, near "use pmFile1." ^ ^ ^ ^
that is a comma not a semicolon;
$ perl -e " use strict. " syntax error at -e line 1, near "use strict." Execution of -e aborted due to compilation errors.

Generic advice :) On debugging, verify everything, talk to teddybear ... checklists and more

Replies are listed 'Best First'.
Re^2: Error "Compilation failed in require" with "use" syntax (eclipse ide)
by SuzuBell (Acolyte) on Oct 03, 2013 at 22:40 UTC
    Thanks for your input.

    When you say: "its @INC path management"; I do not feel too confident working in the terminal. I do not have much experience working with these libraries and such. Is there anything I can do in Eclipse to solve this issue? The strange this is I believe this script was working earlier. I do not know what changed or how to determine that, and how this all relates to INC path management.

    Thanks.

      Is there anything I can do in Eclipse to solve this issue?

      Change the shebang like I showed, it will work with every perl, regardless of where its embedded

      ...

      perlrun#-Idirectory, perlvar#@INC, require, use