Weather::Com::DayForecast - class representing a forecast for one day
[...] my @locations = $weather_finder->find('Heidelberg'); my $forecast = $locations[0]->forecast(); my $tomorrow = $forecast->day(1); print "Forecast for tomorrow:\n"; print " - tomorrow it's the ", $tomorrow->date()->date(), "\n"; print " - sunrise will be at ", $tomorrow->sunrise()->time(), "\n"; print " - maximum temperature will be ", $tomorrow->high(), "\n";
Via Weather::Com::DayForecast objects one can access the weather forecast for one specific day.
This class will not be updated automatically with each call to one of its methods. You need to call a method of your Weather::Com::Forecast object to get updated objects.
You usually would not construct an object of this class yourself. This is implicitely done when you call the day(number of day) or the all() method of a Weather::Com::Forecast object.
day(number of day)
all()
Returns a Weather::Com::DateTime object containing the date the forecast is for.
Returns the maximum temperature that will be reached at daytime.
For day 0 (today), this will be 'N/A' when it's after noon...
There is a bug in weather.com's date and time mathematics: If you are asking for a location's forecast day 0 and it's short after midnight, day 0 will be "yesterday" and you'll get both, yesterday's daytime forecast and night forecast!
I have not investigated this issue further, yet. If anyone has, please inform me!
Returns the minimum temperature that will be reached at night.
Returns a Weather::Com::DateTime object containing the time of sunrise.
Returns a Weather::Com::DateTime object containing the time of sunset.
Returns a Weather::Com::DayPart object with all data belonging to the daytime.
For day 0 (today), this will be undef when it's after noon...
undef
Returns a Weather::Com::DayPart object with all data belonging to the night.
Thomas Schnuecker, <thomas@schnuecker.de>
Copyright (C) 2004-2007 by Thomas Schnuecker
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The data provided by weather.com and made accessible by this OO interface can be used for free under special terms. Please have a look at the application programming guide of weather.com (http://www.weather.com/services/xmloap.html)!
To install Weather::Com, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Weather::Com
CPAN shell
perl -MCPAN -e shell install Weather::Com
For more information on module installation, please visit the detailed CPAN module installation guide.