3

I'm using Eclipse Perl Integration Plugin (EPIC) for developing with Perl. All its functions work great with Perl files (*.pl), but there are problems with Perl modules (*.pm) (I add them to the same project, so project settings are the same): on-the-fly syntax check does not work for them, so that I can't see any errors while coding.
Is it a bug or do I need to recheck any settings?
Thank you.

evgeny9
  • 1,381
  • 3
  • 17
  • 31
  • 2
    Try right-clicking on the file, "Open With", "Epic Perl Editor" – ikegami May 15 '12 at 20:18
  • @ikegami Thank you, but, please, see the comment to aleroot's answer. – evgeny9 May 16 '12 at 11:04
  • I am facing a similar problem . the Include path though is set correct, on clicking the module I can navigate to it. But it shows an error "Compile failed required in". Does anyon has idea about this – Harshavardhan Konakanchi May 16 '12 at 13:28
  • @evgeny9, ok? It just says that you tried it and it worked, or am I missing something? The "but" makes it sound like there was a problem. – ikegami May 16 '12 at 20:49
  • @Harsha Vardhan, Not having the right editor selected in Eclipse is in no way similar to an error compiling some Perl code. – ikegami May 16 '12 at 20:50
  • @ikegami Thank you. I had selected a rigth editor and I found a solution for my problem. The problem with mine is due to unloaded modules and unsupported versions of Modules I have used. Refer the following for queries http://stackoverflow.com/questions/10620149/compilation-fail-in-require-while-using-perl#comment13764459_10620149 – Harshavardhan Konakanchi May 17 '12 at 06:29
  • @ikegami it's OK. I just tried to wait some time to check it (restarting Eclipse and so on). "But" meant, that setting the default editor in settings didn't work for me. Your solution worked, thank you. – evgeny9 May 17 '12 at 10:17
  • @ikegami It's not OK again... The errors (red underlining) are not shown, and can be discovered by launching a connected pl-file only. – evgeny9 Jul 24 '12 at 16:14

2 Answers2

3

It works for me without any problem with each .pl and .pm, so as stated in the comment you should try setting Epic Perl Editor as default editor for pm files too, you can do this right clicking on the pm file on package explorer or navigator and then selecting open With ---> EPIC Perl Editor, as below :

PerlEditor

Once opened with EPIC perl editor the next time will be the default for the file, because in eclipse the default editor for a file is the editor that last opened the file ...

aleroot
  • 71,077
  • 30
  • 176
  • 213
  • Thank you for the answer. "Epic Perl Editor" was already set as my default editor for "*.pm" file type - and syntax check was not working exactly in that editor. Now I reopened the same file with explicit "Open With" and it began to work. I'll try it for a couple of days and will return here if it stops working. – evgeny9 May 16 '12 at 11:01
  • Unfortunately, it stopped working again. And now aleroot's solution does not help. After saving the pm-file it even shows the "Checking Perl syntax" progress bar, but after that shows no errors. But when I try to launch a pl-file, in which this module is included, I get a bunch of errors in the console. Any ideas? – evgeny9 Jul 24 '12 at 16:12
  • @ikegami It can be any and it is every error. For example, `Bareword found where operator expected at ... line ...` – evgeny9 Jul 25 '12 at 14:45
2

It turned out that Perl couldn't locate current module name in @INC, which I included to use another modules in my current module - that's why perl -c was interrupted by error inside of the BEGIN block.

BEGIN {
  push @INC, catdir( dirname( $INC{'ThisModule.pm'} ), qw( .. ModulesFolder1 ) );
  push @INC, catdir( dirname( $INC{'ThisModule.pm'} ), qw( .. ModulesFolder2 ) );
}

It caused the compiler to abort prematurely, which stopped the syntax check.
One of the possible solutions is to just use __FILE__ instead of $INC{'ThisModule.pm'}.

More info about my concrete situation can be found in this SO answer.
And the cause of the problem was found out thanks to the following EPIC support forum topic.

Community
  • 1
  • 1
evgeny9
  • 1,381
  • 3
  • 17
  • 31