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

Here's a little program that talks to the user:

my $foo = user_input("Enter foo:"); my $bar = user_input("Enter bar:"); print "foo x bar is " . $foo * $bar; sub user_input { print shift; return chomp <>; }

Now why can't I do that via http?

sub user_input_http { my $web_page = shift; # print HTTP header... print $web_page; # presumably with a form my %params = &parse_cgi_params; # or whatever }

This offers big improvements over the normal CGI way, where you have to restart your application every time you send a web page, and then figure out the state of your program just from the parameters.

What does Perl offer for this? Is the Apache:: namespace any use? What about other programming languages - is this how e.g. Javabeans work?

I only ask.

dave hj~

Replies are listed 'Best First'.
Re: HTTP within an application
by dws (Chancellor) on Jan 15, 2003 at 06:25 UTC
    What does Perl offer for this?

    HTTP::Daemon will get you started.

    What about other programming languages - is this how e.g. Javabeans work?

    J2EE Entity and Session beans typically run within "containers" exist in an environment that has a built-in web server.

Re: HTTP within an application
by strat (Canon) on Jan 15, 2003 at 12:38 UTC