#!/usr/bin/perl 
#
# script to get the current weather infor from
# http://www.wunderground.com/global/stations/03571.html
# 
#
# v 0.1 john@kript.net
#
# v 0.2 
# cant use warnings due to design of Weather::Underground module
#

#load modules
#use diagnostics;
use strict;
use Weather::Underground;

#declare variables
my ($weather, $arrayref);
#my (@arrayref);

$weather = Weather::Underground->new(
         place   =>      "Cambridge, United Kingdom",
         debug           =>      0
         )
         || die "Error, could not create new weather object: $@\n";

$arrayref = $weather->get_weather()
        || die "Error, calling get_weather() failed: $@\n";

print "The celsius temperature at $arrayref->[0]->{place} is $arrayref->[0]->{temperature_celsius}\n";

print "The humidity is $arrayref->[0]->{humidity}%, conditions are $arrayref->[0]->{conditions}\n";

