3 # This example takes METARs and TAFs from the standard input, parses them
4 # and prints them out in a (sort of readable) normalised form
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 get METARs from ftp://weather.noaa.gov/data/observations/metar
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 $c->as_chunk, "\n";