in reply to Using Perl as a front-end and a back-end to HTML -- is it possible?

How about incorporating something like HTTP::Server::Simple into your program. You can then create the HTML (possibly on-the-fly), and create a URL to point back into your app, and directly receive info via HTML form based interaction. Your app then reacts to these instructions, and re-renders the HTML. (basically, your app becomes a single-purpose web server).

     "For every complex problem, there is a simple answer ... and it is wrong." --H.L. Mencken

  • Comment on Re: Using Perl as a front-end and a back-end to HTML -- is it possible?

Replies are listed 'Best First'.
Re^2: Using Perl as a front-end and a back-end to HTML -- is it possible?
by liverpole (Monsignor) on Mar 19, 2006 at 18:49 UTC
    Thanks, NetWallah, this looks very promising. ++

    I just installed HTTP::Server::Simple with ppm, and I'm looking into using it now.  There isn't apparently a lot of documentation containing actual examples, so I'll need to experiment a bit.  But it's exactly the kind of thing I was searching for.

    Update:  Perhaps I wasn't clear in my original post, but I'm running this on a single machine, so going with a client/server model (eg. running a full-scale webserver to process the page) isn't what I was after.  I realize that http is not the way to go for processing images, but I'm only intending to use it to select images for editing.  That's where the Perl back-end would come in.

    Update 2:  After fussing with HTTP::Server::Simple, I've gotta say, it ain't so Simple.  :(  However, I did come across this excellent node, written by Corion.  I'm studying it now, with the hopes of incorporating some of it into my own program, but I'm already impressed with how quickly I could get it working on my pc.  :)


    @ARGV=split//,"/:L"; map{print substr crypt($_,ord pop),2,3}qw"PerlyouC READPIPE provides"
      You are correct - I had not actually attempted to use the HTTP::Server::Simple module until after your note - and the documentation is very sparse, although it does work, you do need to subclass it, to get anything useful. I apologise for misleading you - what I saw in the minimal documentation made it look appealing.

      If you get into trouble with Corion's 100-liner, you can try the better documented HTTP::Daemon, which documents code for a minimal web server.

      Your original post WAS clear enough - I just liked the idea of a ready-made (browser) client, and a simple, fast web server for your problem space.

           "For every complex problem, there is a simple answer ... and it is wrong." --H.L. Mencken