in reply to Re: Running perl from java
in thread Running perl from java

Hi Marshall, Yes, I have committed the cardinal sin of asking: "how do I implement my solution" and not: "how do I solve my problem".

So here is my problem:

I have a Web application that uses JSF (JavaServer Faces). The Web application needs to display data that is located in a "ClearQuest" database. My version of ClearQuest supports only a perl API, hence the requirement to execute perl from java.

Because it's a Web application, I would like to have all the application files bundled in the one WAR file.

So my problem is how to display the data, obtained from "ClearQuest" using perl, in a Web application?

Cheers, Avi.

Replies are listed 'Best First'.
Re^3: Running perl from java
by afoken (Chancellor) on Jan 06, 2011 at 16:26 UTC
    Because it's a Web application, I would like to have all the application files bundled in the one WAR file.

    Options:

    • Place the perl script inside the WAR file, unpack it on demand, pass the filename of the unpacked script to the perl interpreter.
    • Store the perl script as a string constant inside the Java code, write that string constant into a temp file, pass the filename of the temp file to the perl interpreter.
    • Like before, but use a pipe instead of writing to a physical file, and make the perl interpreter read either stdin or some special file representing perl's end of the pipe (e.g. /dev/fd/4).

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)