Home: Perl Programming Help: Advanced:
WWW::Wunderground::API - Can't bless non-reference value at



appetitto
Novice

Nov 12, 2012, 7:19 AM


Views: 9040
WWW::Wunderground::API - Can't bless non-reference value at

Hi,

I would like to use this module:

http://search.cpan.org/~nebulous/WWW-Wunderground-API-0.04/lib/WWW/Wunderground/API.pm

My code is like here:


Code
use WWW::Wunderground::API; 
#using the json API.
my $wun = new WWW::Wunderground::API(location=>'KIAD', api_key=>'your wunderground API key');

print 'The temperature is: '.$wun->data->temp_f."\n";
print 'The rest of the world calls that: '.$wun->temp_c."\n"; #Keys are AUTOLOADed to $wun->data->$key for lazy typers.
#print 'XML source:'.$wun->xml if $wun->api_type eq 'xml';
print 'JSON source:'.$wun->json if $wun->api_type eq 'json';


Output:


Quote
Can't bless non-reference value at /usr/local/share/perl5/Hash/AsObject.pm line 82.


Have you got any idea how I can fix it?

Thanks in advance


wickedxter
User

Dec 4, 2012, 5:21 PM


Views: 8324
Re: [appetitto] WWW::Wunderground::API - Can't bless non-reference value at

I see your copying the code from the POD of the module.. do you have the API key? its askin for?

have you tried the other's ?

Code
#location 
my $wun = new WWW::Wunderground::API('Fairfax, VA');

#or zipcode
my $wun = new WWW::Wunderground::API('22030');

#or airport identifier
my $wun = new WWW::Wunderground::API('KIAD');