3 # This example takes METARs and TAFs from the standard input and
4 # prints them out in a readable form, in something approaching English
6 # Note that this is a state machine which can take any old rubbish and looks
7 # for a start of a forecast in the input. It then searches for a blank line
8 # before looking for the next.
10 # You can METARs from ftp://weather.noaa.gov/data/observations/metar/ and
11 # TAFs from ftp://weather.noaa.gov/data/forecasts/taf/ and
12 # from ftp://weather.noaa.gov/data/forecasts/shorttaf/
13 # directories. This program will parse these files directly
15 # You will need to press <return> twice to get any output if you are entering
20 # Copyright (c) 2003 Dirk Koopman G1TLH
34 if ($in =~ /(?:METAR|TAF)/) {
36 } elsif ($in =~ /[QA]\d\d\d\d/) {
49 next unless Geo::TAF::is_weather($_);
61 print $t->raw, "\n\n";
64 foreach my $c ($t->chunks) {
65 # print "\n", $c->as_chunk, " ";
66 if ((ref $c) =~ /::(?:PROB|TEMPO|BECMG|FROM)$/) {
70 print $spc, $c->as_string;
71 if ((ref $c) =~ /::(?:VALID)$/) {