#!/usr/bin/perl use common::sense; use DBI; print "Status: 200\nContent-Type: text/plain\n\n"; $|=1; $|=0; # flush my $dbh=DBI->connect('dbi:Pg:dbname=r2', 'ipp', undef, {RaiseError=>1}); my $sth=$dbh->prepare('select burncpu(?)'); $sth->execute((($ENV{QUERY_STRING}+0) || .5).'s'); while( my $row=$sth->fetchrow_arrayref ) { print "@$row\n"; }