#!/usr/bin/perl -w # # this is a test script for idm 3020 # It's very simple, we read in a data file and display a result # based on the read data # # N. Atkins 9/18/02 # # define input file # $input_file = "natestdata.txt"; # # now, let's open the file # open(DATA, $input_file) or die "Can't open input data file: $!\n"; # # read in the data # while($line = ){ chomp($line); ($day, $month, $year, $pres, $temp, $td, $wd, $ws) = split(" ",$line); } print "day:" . $day . "\n"; print "month:" . $month . "\n"; print "year:" . $year . "\n"; print "pres:" . $pres . "\n"; print "temp:" . $temp . "\n"; print "td:" . $td . "\n"; print "wd:" . $wd . "\n"; print "ws:" . $ws . "\n"; # # now, let's grab the appropriate wind direction graphic # if ($wd >= 0. and $wd <= 45.) { $windgif="../../classes/idm3020/testgifs/north.gif"; } elsif ($wd > 45. and $wd <= 135.) { $windgif="../../classes/idm3020/testgifs/east.gif"; } elsif ($wd > 135. and $wd <= 225.) { $windgif="../../classes/idm3020/testgifs/south.gif"; } elsif ($wd > 225. and $wd <= 315.) { $windgif="../../classes/idm3020/testgifs/west.gif"; } else { $windgif="../../classes/idm3020/testgifs/north.gif"; } # print "windgif: " . $windgif . "\n"; # # OK, now let's write out the html # print "Content-type: text/html\n\n"; # print < TEST PAGE FOR IDM 3020

OK, here we go.....!

the file we are opening is called: $input_file

Pressure: $pres
Temperature: $temp
Dew Point: $td
Wind Speed: $ws
Wind Direction: $wd
EOP exit