#cricket.cgi by Tim Brice NWSO El Paso
MAIN:
{
&ReadParse(*chirp);
print &PrintHeader;
print "\n";
print "Cricket chirps to temperature calculator \n";
print "\n";
if ($chirp{chirps} =~ /-?(\d+)\.?(\d+)|\d+/) {
$cp15 = $chirp{chirps};
} else {
print "An illegal character was entered\n";
die
}
$f = $cp15 + 40;
$celsius = 5/9 * ($f - 32);
$abs = $celsius + 273.16;
$~ = "TEMP1";
write;
format TEMP1 =
@#### cricket chirps in 15 seconds equals:
$chirp{chirps}
@##.# degrees Fahrenheit
$f
@##.# degrees Celsius
$celsius
@##.# Kelvin
$abs
.