Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

perl script handled by java

by tart (Beadle)
on Nov 23, 2011 at 03:51 UTC ( #939584=perlquestion: print w/replies, xml ) Need Help??
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,


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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://939584]
Approved by Ratazong
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2016-12-08 17:38 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (144 votes). Check out past polls.