Hi there,
I updated my Eclipse (Windows 7) form Mars v2 to 2018-09 and EPIC 0.6 to 0.7.7. My Perl version is 5.6.0. Now if I want to use the build-in formatter I receive the following error message:
Failed to execute command line: "perl" "perltidy" "-q" "--indent-columns=4" "--maximum-line-length=80" "--entab-leading-whitespace=4" "--opening-brace-on-new-line" "--line-up-parentheses"
Sadly this happens on my workstation at work and I am unable to use the older versions. I played with the formatter configuration in Eclipse, but nothing worked so far. I have no clue want went wrong. Is this a known issue? Does anyone know how to fix this? Is this a PATH problem? Do I need to update Perl?
Thank you for your help in advanced.
Best reguards
Andreas
Try specifying an aboslute path to Perl executable in Window > Preferences > Perl.
Check workspace/.metadata/.log if it contains more details about why the exectuion failed.
What's supposed to happen when you invoke the Source > Format function is that the command line you quoted as failed is executed in working directory workspace/.metadata/.plugins/org.epic.perleditor/perlutils/perltidy - into which the perltidy version shipped with EPIC is extracted beforehand.
Thank you for your quick answer.
Sadly after setting an absolute path the error stays the same.
Here is excerpt for my log file:
Try running that comand line yourself from the cmd.exe prompt, after changing to the working directory mentioned in my first reply and piping the source file to be formatted as standard input. It may be that perltidy is aborting for some reason, perhaps because of the content of your source file. Does it work with other ("Hello world") files?
I also tried to get around this by setting the .perltidyrc into my project root folder but this neither helped.
Hmm, ...
It looks like perltidy can not find the Tidy.pm module in the Perl subfolder.
Here is an dir output that proofs the folder and file exists:
C:\Projects\Perl.metadata.plugins\org.epic.perleditor\perlutils\perltidy\perltidy
C:\Projects\Perl.metadata.plugins\org.epic.perleditor\perlutils\perltidy\Perl\Tidy.pm
It should check the subfolders of current caller path:
BTW, the Taint mode is not checked in the EPIC settings.
You are probably in wrong directory. You're supposed to "cd \Projects\Perl.metadata.plugins\org.epic.perleditor\perlutils" first and then run the "C:\Perl\bin\Perl.exe" perltidy params < sourcefile.pl from there.
Ok, I got it!
It seems that my Perl installation is missing the Encode module. I've tried another Perl version (just an old test installation 5.14.x) in which the module exists and et voila it works!
Now I need to convince my IT admins to release a newer version with the module, but this is not your problem.
Please close this ticket.
Many Thanks for your help
Andreas
Last edit: Codenascher 2018-11-14
Ouch, I now see that you mentioned Perl 5.6 - this is 18 years old by now... Yes, you should use a more recent Perl version.