CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



appetitto
Novice

Nov 12, 2012, 7:19 AM

Post #1 of 2 (5138 views)
WWW::Wunderground::API - Can't bless non-reference value at Can't Post

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

Post #2 of 2 (4422 views)
Re: [appetitto] WWW::Wunderground::API - Can't bless non-reference value at [In reply to] Can't Post

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');


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives