#!/usr/bin/env perl use strict; use warnings; use 5.24.0; use WWW::Wunderground::API; my $w = new WWW::Wunderground::API( location => '12123', api_key => 'nxnxnxnx', # API value concealed; your own is freely avail at Wunderground auto_api => 1, lang => 'EN', ); my $home_location = 'Xxxx, XX'; # capture location print "Enter city or zip code ($home_location): "; my $location = <>; chomp $location; binmode STDOUT, ':utf8'; # for degrees symbol # print source_time say "\n WeatherUnderground forecast as of " . scalar localtime . "\n"; # print header printf "%-10s%-6s%-6s%-8s%-20s\n", 'Time', "TempF", "TempC", 'Rain %', 'Conditions'; # print hourly for (@{ $w->hourly }) { printf "%8s%6i%6i%8i %-30s\n", $_->{FCTTIME}{civil}, $_->{temp}{english}, $_->{temp}{metric}, $_->{pop}, $_->{condition}; }