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

Howdy Monks,

Normally, to serve a dynamic graph (via STDOUT without having to write to the disk first) within a Webpage, I can just do that:
#! /usr/local/bin/perl -w use strict; use Apache::Request (); my $r = shift; $r->content_type('text/html'); $r->send_http_header; print <<EOM; <html><body> <p>My Chart</p> <p><img src=MyGD.pl></p> <p>The End</p> </body></html> EOM
That is, just point my image source to the Perl script that generates the graph. But how do I do something equivalent with a standalone HTML page on my desktop without CGI and Webserver?

Are there pure client-side scripting solutions (be it PerlScript, JavaScript or VBScript)?

I could use Net::Daemon to write a mini Webserver, and I did, but then I might as well use Apache. I could just use Tk as well, yet I'm curious how to serve a graph dynamically (via STDOUT without writing to disk first) on a standalone HTML page on my desktop (since if I let the browser, a PerlScript or a VBScript could read/write files or even execute programs from within a browser, so I thought it should be able to serve graph dynamically, and more or less easily as in CGI, from within a browser on client-side alone).

There got to be more than one way to do it, right? Without needing a Webserver and CGI at all.

Thanks.

Replies are listed 'Best First'.
Re: <img src=MyGD.pl> w/o CGI?
by sauoq (Abbot) on Sep 13, 2002 at 23:45 UTC

    You could use a named pipe if you were on a unix box. I'm guessing that you aren't though, given your mention of VBScript. I'm not sure if Windows has anything comparable.

    -sauoq
    "My two cents aren't worth a dime.";