Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

applet to perl cgi

by spercy (Initiate)
on Mar 25, 2009 at 05:12 UTC ( [id://753013]=perlquestion: print w/replies, xml ) Need Help??

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

hi, I need to invoke perl script from an applet..can any one tell me the procedure to do..also can i invoke a perl program(that gets input from std i/o) from an applet..if that program is not possible,then can a invoke a perl method...

Replies are listed 'Best First'.
Re: applet to perl cgi
by CountZero (Bishop) on Mar 25, 2009 at 06:24 UTC
    It depends.

    • Where is the applet?
    • Where is the perl-script?
    • Can the applet make a system call to start the perl-script?
    • What do you mean by "also can I invoke a perl program (that gets input from st i/o) from an applet"? How is that different from "I need to invoke perl script from an applet"?
    • What "perl method" are you thinking of invoking?
    • In what language is the applet written? Do you have access to its source code?
    • ...
    And most important: What have you tried?

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

      Hi, thanks for ur reply...to b clear,i have written a perl program for TGDH algorithm..i.e.,whenever a new user joins the dynamic group,a node 'll b created for that user in a tree structure..user entry applet is written in java..only the tree formation program i have written in perl..i need to send the user entry details to be sent to the perl program and the result to b returned to the applet..can any one tell me the format with a simple eg r kindly tell me any reference where i could know abt tat...
        Which questions CountZero asked you do you think you are answering?
Re: applet to perl cgi
by dHarry (Abbot) on Mar 25, 2009 at 09:40 UTC

    This is not really a Perl question but a Java security question (I’m assuming you mean Java applets!).

    I'd say it depends on the version of Java that is used to run the applet. In early versions applets, by design, had many restrictions. They run in the applet sandbox. Therefor it is impossible to read/write files or start programs on the host executing the applet (there are many more restrictions). So it used to be impossible.

    In the course of time the Java security model was seen as too restrictive and things started to change. Right now, I am not convinced it is impossible but I would strongly recommend against it. The best advice I can give is to rethink the problem!

    If you insist of running something from an applet I suggest you investigate javasecurity/applets.

    HTH
    dHarry

Re: applet to perl cgi
by dorward (Curate) on Mar 25, 2009 at 09:42 UTC

    Since you mention "perl cgi" in the subject line, I'm going to assume you mean:

    "Cause a Java Applet running in a web browser to cause a web server to run a Perl program using a CGI interface."

    ... in which case, Perl has very little to do with it. Assuming the server is configured correctly to run the CGI, all you have to do is cause the Applet to issue an HTTP request to the server.

    That requires you to write Java code, unless the Applet is already capable of making such requests.

Re: applet to perl cgi
by Anonymous Monk on Mar 25, 2009 at 05:49 UTC

    So you're running a web-server in some unspecified location, and you want your web browser to spawn a Perl script running on your client machine when instructed by the applet you've loaded from the remote web-server?

    The short answer is that you've just asked if it's possible to walk from Sydney to Melbourne. Not 100% sure on that, but I know there are much better ways of achieving the goal..

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://753013]
Approved by planetscape
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-19 17:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found