#!/usr/bin/perl -wT use strict; use CGI; my $q = new CGI; my $timestamp=localtime; my $city = $q->param ( "city" ); my $temperature=sprintf "%d", rand 100; if ( !$city ) { $city = "Unknow"; } print "Content-type: text/html\n\n"; print ""; print "
Temperature today in $city is $temperature
"; print "
Generated on
$timestamp
"; print "TTL is 60s
"; print "
";