•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 | [reply] |
|
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
| [reply] |
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 | [reply] [d/l] [select] |
|
| [reply] |
|
| [reply] |
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] | [reply] |
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").
| [reply] |
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
| [reply] |
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 | [reply] |