Skip Menu |

This queue is for tickets about the Weather-YR CPAN distribution.

Report information
The Basics
Id: 74112
Status: resolved
Priority: 0/
Queue: Weather-YR

People
Owner: knut-olav [...] hoven.ws
Requestors: 'spro^^*%*^6ut# [...] &$%*c
Cc: knut?olav [...] hoven.ws
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.24
Fixed in: (no value)



CC: knut−olav [...] hoven.ws
Subject: Misuse of length on array
$ ack 'length\s*@' lib/Weather/YR/Locationforecast.pm 29: push @forecasts, $forecast_ref unless length @forecasts; length() only applies to scalars, so length @forecasts will evaluate @forecasts in scalar context, which returns the number of elements. That number will be passed to length(), which will tell you how many digits there are. Then ‘unless’ will see a positive number, so the push never happens. You just need: push @forecasts, $forecast_ref unless @forecasts;
Thanks for reporting! It's now fixed in 0.25.