Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Error "Compilation failed in require" with "use" syntax (eclipse ide)

by Anonymous Monk
on Sep 16, 2013 at 02:55 UTC ( #1054211=note: print w/ replies, xml ) Need Help??


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


Comment on Re: Error "Compilation failed in require" with "use" syntax (eclipse ide)
Select or Download Code
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1054211]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2014-09-17 20:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (99 votes), past polls