Skip Menu |

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

Report information
The Basics
Id: 19001
Status: new
Priority: 0/
Queue: Weather-Underground

People
Owner: Nobody in particular
Requestors: bob [...] bob-n.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 3.02
Fixed in: (no value)



Subject: Succesful Methods still set $@ (corrected bug report)
This ticket is a near duplicate because I bothed the "broken in" and "fixed in" fields. When used with debug => 0 and while running successfuly, the new() and get_weather() methods return with $@ set, even when successful. This causes some other programs, notably Xchat, to think that something is wrong when it is not. I am using this program in a midified version (attached) of the weather.pl script (http://paralox.org/downloads/weather.tar.gz) for Xchat. Xchat emits error messages even when all is apparently well. I'm not sure that $@ is a good place to store non-fatal error messages. If the email address above doesn't work, use bobniederman@speakeasy.net
Subject: weather.pl
#!/usr/bin/perl # Usage: /weather <zipcode> # Author: epoch @ irc.cyberchat.org use Weather::Underground; use Xchat qw(:all); Xchat::register('weather.pl','1.0'); # Xchat::print"* Weather Script Loaded..."; my $weather1 = sub { my $weather = Weather::Underground->new(place => $_[1][1], debug => 0 ) or die "Error, could not create new weather object: $@"; $arrayref = $weather->get_weather() or die "Error, calling get_weather() failed: $@\n"; Xchat::print(" Weather Report For: $arrayref->[0]->{place}"); Xchat::print(" Fahrenheit: $arrayref->[0]->{temperature_fahrenheit}"); Xchat::print(" Celsius: $arrayref->[0]->{temperature_celsius}"); Xchat::print(" Humidity: $arrayref->[0]->{humidity}"); Xchat::print(" Conditions: $arrayref->[0]->{conditions}"); # Xchat::print(" Wind: $arrayref->[0]->{wind}"); Xchat::print(" Pressure: $arrayref->[0]->{pressure}"); Xchat::print(" Updated: $arrayref->[0]->{updated}"); return Xchat::EAT_ALL; }; Xchat::hook_command('weather', $weather1);