Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Setting up client-side perlscript

by JimE (Initiate)
on Sep 29, 2002 at 14:58 UTC ( [id://201551]=perlquestion: print w/replies, xml ) Need Help??

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

I want to run some client-side perlscript WITHOUT using ActiveState's tools for IE. In other words, I want to create the link between a browser (IE and Netscape, on both Win32 and *Nix) and an existing perl installation on a client machine so as to run perlscript in the browser without any server connection. Essentially I want to use the browser as a simple OS independent GUI and avoid Tk. Anybody ever done this outside of ActiveState? So far I've found precious little documentation (read none!) on how this is done although it can't be hard--the ActiveState perlscripting engine dll for Win32 is only 70KB. Presumeably there is something buried somewhere in the MS Libraries for Win32, but I have been able to turn it up yet. Any thoughts would be most appreciated. TIA JimE

Replies are listed 'Best First'.
•Re: Setting up client-side perlscript
by merlyn (Sage) on Sep 29, 2002 at 15:19 UTC
    A "browser" can't run things. Set up a webserver, or maybe even a mini-webserver using HTTP::Daemon, and hook URLs to scripts via CGI. Then point your browser at your server.

    Make sure your webserver is bound to localhost (127.0.0.1), and not to a routable IP address (or wildcard), or else you'll have to think about all sorts of security issues. {grin}

    -- Randal L. Schwartz, Perl hacker

      A "browser" can't run things.

      Actually most browsers do run things, be it javascript, java or the oh-so-scary MS vbscript stuff. Not to mention Emacs, which is among other things a browser and can run almost anything.

      This said, you could write a perl interpreter written in javascript, or even better a javascript linux-emulation layer and execute perl on top...

      I'd offer more solutions to this problem, but this one-sleeved shirt makes typing very hard.

      The stupider the astronaut, the easier it is to win the trip to Vega - A. Tucket
Re: Setting up client-side perlscript
by traveler (Parson) on Sep 29, 2002 at 16:48 UTC
    The answer is, you don't have to do much. Check out this code:
    <html> <head> <title>PerlScript Demo</title> </head> <body> <h1>PerlScriptDemo</h1> <script language="PerlScript"> $window->document->write('This comes from perl\n'); </script> </body> </html>
    Note the language="PerlScript". This works on my Win32box with ActiveState installed. No other magic.

    HTH, --traveler

      It works because ActiveState is installed. They don't want that.

        When JimE said, WITHOUT using ActiveState's tools for IE I did not take that to mean without any ActiveState tools at all. I do not have IE installed...

        It seems that something would have to be installed, at least the necessary perl modules and and interpreter. One might be able to use a plugin to invoke the interpreter.

        --traveler

Re: Setting up client-side perlscript
by jjdraco (Scribe) on Sep 29, 2002 at 20:53 UTC
    I'm just learning so maybe i'm wrong but -- wouldn't using Tk allow it to be OS independent.
    I would think that it would be more trouble than its worth to do
    what you want with out a perl interpretor already installed. but i could be wrong

    [jjdraco]
Re: Setting up client-side perlscript
by fglock (Vicar) on Sep 29, 2002 at 22:52 UTC

    You can make the users download a perl program, just like they download a PDF or EXE file.

    The browser will ask the users if they want to save or execute, the user press "execute" and the script runs (they need to have perl installed).

    But it will not run in the browser context ("PerlScript") - it will be just another perl application ("JAPA").

Re: Setting up client-side perlscript
by JimE (Initiate) on Sep 29, 2002 at 23:34 UTC
    Thanks all for the suggestions. Here's a little amplification. All the client machines already have perl installed, so perlscript is an obvious choice. Javascript, which is already built-in to many browsers, is an alternative, but means translating and maintaining some existing perl routinesino Javascript--not ideal. The ActiveState perlscripting engine (and the ActiveState distro) is ruled out for other reasons, as are a local webserver on each client and Tk. JimE
Re: Setting up client-side perlscript
by rbi (Monk) on Sep 30, 2002 at 11:26 UTC
    Hi,
    You might check Pi3Web on SourceForge
    Regards, Roberto

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2024-04-23 13:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found