CGI programming in Perl1

gav on 2003-07-03T02:21:16

Since Michael Schwern became perl1 pumpking I've had crazy ideas about backporting cgi-lib to perl1. This is as far as I've got so far, but I'm plugging away.

#!/usr/bin/perl1
print "Content-Type: text/plain\n\n";

do ReadParse();

while (($k, $v) = each(vars)) {
    print "$k = $v\n";
}

sub ReadParse {
    $_ = $ENV{'QUERY_STRING'};
    @in = split(/&/);
    for ($i = 0; $i <= $#in; $i++) {
        $in[$i] =~ tr/+/ /;
        if ($in[$i] =~ /^([^=]+)=(.*)/) {
            $vars{$1} = $2;
        }
    }
}

The cool thing about perl1 is that the binary is only 162k and it compiles fine on OS X.


hmm

koschei on 2003-07-03T02:44:56

Now we just need to port perl1 to parrot...

Re:hmm

acme on 2003-07-03T13:51:36

I haven't had the time so far ;-)