in reply to Measure temperature outside in Perl

use 5.010; use strict; use Web::Magic 0.007; my %opts = ( 'w' => 26191, # Yahoo WOEID 'u' => 'c', # Unit: 'c' or 'f' ); my ($temperature) = Web::Magic -> new(q<>, %opts) -> findnodes('//yweather:condition/@temp') -> map(sub { $_->value }); say "Temperature is $temperature";

Works for me!

Update: Yahoo WOEIDs (Where On Earth Identifier) are numeric identifiers used by Yahoo for places. Here's a tool to look up WOEIDs. The WOEID in the script above is for Lewes, East Sussex.