Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^4: Alternative to CGI.pm

by RonW (Parson)
on Apr 05, 2017 at 23:06 UTC ( [id://1187196]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Alternative to CGI.pm
in thread Alternative to CGI.pm

Maybe. The USB "stick" that had the back up copy is long lost, though the PC it ran is still gathering dust. Hasn't been powered for over 10 years, so I have no idea if the hard disk or any of it will function any more.

The C program was a basic TCP server with a while loop to accept a connection, fork, read the HTTP header line-by-line, slurp the content (Perl equiv: sysread($connection, $buffer, $contentlength)), use strchr(buffer, '\r') to break the content (which was assumed to be "application/x-www-form-urlencoded") into "key=value" pairs and build an array of pointers (the HTTP headers were also included in the array). Then it would execle(awkint, awkint, awkscript, NULL, array).

The AWK script would then access the HTTP and form fields as environment variables, doing url-decode as needed, process the request and generate the response, including the HTTP headers, streaming it out STDOUT.

This wasn't hard, just very tedious. My co-workers dubbed me "The Wizard of AWK".

Then I "discovered" Perl.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1187196]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-23 14:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found