CGI and Perl

PenguinA New Paradigm in Remote Execution

One of the most interesting and potentially useful examples of remote Perl code execution doesn't use the Web at all. As we've previously mentioned, it's arguable whether the most important tasks that need to be executed on remote clients really need a user interface at all. Administration tasks, remote processing, CPU sharing, and other important tasks don't necessarily require spinning mazes or little fat guys jumping around on the screen.

The Penguin module is a complete interface and execution environment all by itself. We mention it here because it's designed in a way that utilizes the most important of the features we mentioned earlier in the chapter in our list of desirable characteristics for an embedded Perl in a Web browser.

The Penguin runs the code it receives in a configurable Safe environment. The configuration of the Safe compartment is done automatically, depending on the PGP signature of the "Frame" that is sent from the remote end. If it's from someone you trust, more opcodes can be permitted; if not, then little or nothing, in terms of allowable ops, is the default. It also provides a means of encryption of the transaction via PGP. The Penguin's output is usually limited to files or text, but in theory, it should be able to execute any given module like Tk or OpenGL if you trust the sender enough.

A Penguin is simply a Perl object that, when instantiated with the new() method, can be set up to be either a server or a client with the capability to switch back and forth between the two, to effect a "conversation" between two Penguins consisting of Perl scripts that execute on each side and return results to the other side. The Penguin uses the handy and very stable IO module to do all of its communication on the socket between it and the remote Penguin. Since the IO module is now (as of 5.003_02) shipping with Perl as a core module, you'll be all set once you get the preceding mentioned items.

You can obtain the Penguin module from the CPAN. You'll also need a PGP executable and, of course, the Safe module. When you've got the required components installed, you can try it out. To do this, you'll need to set up your own PGP keyring and write up a little Perl script to pgp-sign and have it sent to the client. The version of Penguin we tried was an early alpha.

If you need a remote secure execution environment, but not necessarily within a Web browser, give the Penguin a try. You can get it at:

    http://www.eden.com/~fsg/penguin/

According to its author, the Penguin is capable of the following: The combination of these functions enable direct Perl coding of algorithms to handle safe Internet commerce, mobile information-gathering agents, "live content" Web browser helper apps, distributed load-balanced computation, remote software update, distance machine administration, content-based information propagation, Internet-wide shared-data applications, network application builders, and so on. Definitely an exciting development in the Perl community. Check it out.

by BrainBellupdated
Advertisement: