X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=Geo%2FTAF%2Fexample%2Fcmd_metar.pl;fp=Geo%2FTAF%2Fexample%2Fcmd_metar.pl;h=9ac8418fa966cf8653cbe086a0497a399762ba69;hb=3cc09786f798ed89076f05b538f726d397fdface;hp=0000000000000000000000000000000000000000;hpb=134ff86ce9df4a188bfee84ce4ce8ae3682a6b7a;p=spider.git diff --git a/Geo/TAF/example/cmd_metar.pl b/Geo/TAF/example/cmd_metar.pl new file mode 100755 index 00000000..9ac8418f --- /dev/null +++ b/Geo/TAF/example/cmd_metar.pl @@ -0,0 +1,18 @@ +#!/usr/bin/perl +# +# This example takes METARs from the standard input and +# prints them out in a readable form +# + +use strict; +use Geo::TAF; + +while () { + chomp; + next if /^\s*$/; + next unless Geo::TAF::is_weather($_); + my $t = new Geo::TAF; + $t->metar($_); + print $t->raw, "\n\n"; + print $t->as_string, "\n\n"; +}