http://www.perlmonks.org?node_id=939584

tart has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I am not sure if this is the right place to ask this question but I have no options so here I am,

I want to know if there are ways jsp can interact with perl script.

From GUI(JSP) I want to,
1. execute the perl script.
2. capture the STDOUT generated by perl script.
3. check for error $?.
4. handle STDIN.

So I am just looking for suggestions from experienced Monks if there are any libraries available in java to make the java and perl interaction reliable to achieve what I want to do please let me know.
I am novice programmer so please feel free to post your suggestion (whatever you have in your mind) regarding what I want to achieve,

Appreciate any suggestion,

Thanks

Replies are listed 'Best First'.
Re: perl script handled by java
by Utilitarian (Vicar) on Nov 23, 2011 at 11:33 UTC
    Tomcat supports CGI, so an AJAX call to the Perl script within the JSP template is one possible workaround.

    print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."
Re: perl script handled by java
by Anonymous Monk on Nov 23, 2011 at 07:36 UTC

    So I am just looking for suggestions

    Look in the manual, use system/process as search term. Heck, you can even use STDIN/STDOUT/STDERR. This is universal. It should take all of 1 minute with a good search engine.