Weather::OpenWeatherMap::Result::Forecast - Weather forecast result
# Normally retrieved via Weather::OpenWeatherMap
This is a subclass of Weather::OpenWeatherMap::Result containing the result of a completed Weather::OpenWeatherMap::Request::Forecast.
These are normally emitted by a Weather::OpenWeatherMap instance.
Boolean true if this is an hourly weather report.
The number of forecast days returned by the OpenWeatherMap API.
See "list" and "iter".
The country string.
The OpenWeatherMap city code.
The station's latitude.
The station's longitude.
The city name.
The full forecast list, as a List::Objects::WithUtils::Array.
See "list".
The full forecast list; each item in the list is either a Weather::OpenWeatherMap::Result::Forecast::Day (by default) or a Weather::OpenWeatherMap::Result::Forecast::Hour (if "hourly" is true) instance:
for my $day ($result->list) { my $date = $day->dt->mdy; my $cloudiness = $day->cloud_coverage; # ... }
See the documentation for Weather::OpenWeatherMap::Result::Forecast::Day & Weather::OpenWeatherMap::Result::Forecast::Hour.
Returns an iterator that, when called, returns the next Weather::OpenWeatherMap::Result::Forecast::Day or Weather::OpenWeatherMap::Result::Forecast::Hour instance (or undef when the list is empty):
my $iter = $result->iter; while (my $day = $iter->()) { my $wind = $day->wind_speed_mph; # ... }
The number of items to return at a time can be provided (as of v0.4.x):
v0.4.x
my $iter = $result->iter(3);
See also: "list"
Weather::OpenWeatherMap::Result
Weather::OpenWeatherMap::Result::Forecast::Block
Weather::OpenWeatherMap::Result::Forecast::Day
Weather::OpenWeatherMap::Result::Forecast::Hour
Weather::OpenWeatherMap::Result::Current
Jon Portnoy <avenj@cobaltirc.org>
To install Weather::OpenWeatherMap, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Weather::OpenWeatherMap
CPAN shell
perl -MCPAN -e shell install Weather::OpenWeatherMap
For more information on module installation, please visit the detailed CPAN module installation guide.