Weather::Underground

Aus Wiki.csoft.at

Aktuelles Flugwetter anzeigen

#!/usr/bin/perl
use Weather::Underground;
$city=shift;
$country=shift;
if (!$city || !$country) {
  $city="Schwechat"; $country="Austria";
  # $city="Phuket"; $country="Thailand";
}
$weather = Weather::Underground->new(
  place => "$city, $country", 
  debug => 0,
)
|| die "Error, could not create new weather object: $@\n";
$arrayref = $weather->get_weather()
|| die "Error, calling get_weather() failed: $@\n";
foreach (@$arrayref) {
  print "MATCH:\n";
  while (($key, $value) = each %{$_}) {
    print "\t$key = $value\n";
  }
}


Siehe auch