cannot get perltidy to work

cowgod wrote on Fri Oct 31 20:01:06 CET 2008:
i've tried everything i can think of and i cannot get perltidy to work.
 i really hope someone can help me because the code i'm working on is in
dire need of tidying.  when i have a perl file open, I select Source->Format
and i'm greeted with the following error in my .metadata/.log file:

!SESSION 2008-10-31 11:51:47.397 -----------------------------------------------
eclipse.buildId=I20080617-2000
java.version=1.6.0_07
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86

!ENTRY org.epic.perleditor 4 0 2008-10-31 11:54:40.147
!MESSAGE Failed to execute command line: "C:\Perl\bin\perl.exe" "-IC:\workspace\.metadata\.plugins\org.epic.perleditor\perlutils\perltidy"
"-IC:\workspace\myproj\eclipse-shells" "-IC:\workspace\myproj" "-IC:\workspace\myproj\lib"
"perltidy" "-q" "--indent-columns=4" "--maximum-line-length=76" "--continuation-indentation=4"
"--nooutdent-labels" "--nooutdent-long-lines" "--paren-tightness=2" "--nospace-for-semicolon"
"--delete-closing-side-comments" "--opening-brace-always-on-right"
!STACK 0
java.io.IOException: The pipe has been ended
	at java.io.FileOutputStream.writeBytes(Native Method)
	at java.io.FileOutputStream.write(FileOutputStream.java:260)
	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
	at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:278)
	at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:122)
	at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:212)
	at org.epic.core.util.ProcessExecutor.execute(ProcessExecutor.java:160)
	at org.epic.core.util.ProcessExecutor.execute(ProcessExecutor.java:71)
	at org.epic.core.util.PerlExecutor.execute(PerlExecutor.java:99)
	at org.epic.core.util.ScriptExecutor.run(ScriptExecutor.java:84)
	at org.epic.perleditor.editors.util.SourceFormatter.format(SourceFormatter.java:61)
	at org.epic.perleditor.editors.util.SourceFormatter.format(SourceFormatter.java:45)
	at org.epic.perleditor.actions.FormatSourceAction.runFormatter(FormatSourceAction.java:127)
	at org.epic.perleditor.actions.FormatSourceAction.doRun(FormatSourceAction.java:45)
	at org.epic.perleditor.actions.PerlEditorAction.run(PerlEditorAction.java:37)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.ui.actions.RetargetAction.runWithEvent(RetargetAction.java:230)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:234)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:583)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:500)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3823)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3422)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2382)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2346)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2198)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:382)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1212)

jploski wrote on Fri Oct 31 20:08:03 CET 2008:
If you try running the same command line quoted in the error message in
the cmd.exe box, and redirect standard input/output, does it work then or
does it fail?

I mean something like

"C:\Perl\bin\perl.exe" "-IC:\workspace\.metadata\.plugins\org.epic.perleditor\perlutils\perltidy"
"-IC:\workspace\myproj\eclipse-shells" "-IC:\workspace\myproj" "-IC:\workspace\myproj\lib"
"perltidy" "-q" "--indent-columns=4" "--maximum-line-length=76" "--continuation-indentation=4"
"--nooutdent-labels" "--nooutdent-long-lines" "--paren-tightness=2" "--nospace-for-semicolon"
"--delete-closing-side-comments" "--opening-brace-always-on-right" < c:\path\to\the\sourcefile.pm
> c:\path\to\the\sourcefile-tidy.pm
cowgod wrote on Sat Jan  3 00:41:27 CET 2009:
If I run the command as you have it I get the error Can't open perl script
"perltidy": No such file or directory.  If I add the full path to perltidy
then the command executes successfully, but the resulting perl file is empty!
 Any other suggestions?
cowgod wrote on Sat Jan  3 00:56:07 CET 2009:
On a whim I decided to try Strawberry Perl @ http://www.strawberryperl.com
instead of ActiveState Perl.  Now it works!  Go Strawberry Perl!
cowgod wrote on Fri Oct 31 20:23:15 CET 2008:
actually, no i can't.  i get the following error:

Can't open perl script "perltidy": No such file or directory

however, I have verified that the following files exist:

C:\workspace\.metadata\.plugins\org.epic.perleditor\perlutils\perltidy\Perl\Tidy.pm
C:\workspace\.metadata\.plugins\org.epic.perleditor\perlutils\perltidy\perltidy
cowgod wrote on Fri Oct 31 21:30:08 CET 2008:
trying it on the command line with the full perltidy path doesn't produce
an error, but gives an empty result file.  why?

C:\>perl -I"C:\workspace\.metadata\.plugins\org.epic.perleditor\perlutils\perltidy"
c:\workspace\.metadata\.plugins\org.epic.perleditor\perlutils\perltidy\perltidy
"-q" "--indent-columns=4" "--maximum-line-length=76" "--continuation-indentation=4"
"--nooutdent-labels" "--nooutdent-long-lines" "--paren-tightness=2" "--nospace-for-semicolon"
"--delete-closing-side-comments" "--opening-brace-always-on-right" < c:\test.pl
> c:\test.tidy.pl
jploski wrote on Fri Oct 31 22:23:25 CET 2008:
Which version of EPIC is that? If 'stable' 0.5.x, then switch to the most
recent 'testing' 0.6.27, which has a more up-to-date version of perltidy.
cowgod wrote on Fri Oct 31 22:51:16 CET 2008:
i am using 0.6.25.  what i'd like to do is completely wipe out all version
of epic and start from scratch, however i really don't want to lose all
my config settings.  is there a file i can save away and then blast all
my epic folders and reinstall and then put the config back?
jploski wrote on Fri Oct 31 23:43:16 CET 2008:
Preferences are in workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.epic.perleditor.prefs

Launch configurations in workspace/.metadata/.plugins/org.eclipse.debug.core/.launches

They are not erased when you remove plugins/features afaik.

Note: The above is an archived snapshot of a forum thread. Use the original thread at sf.net to post comments.