【发布时间】:2012-11-01 16:10:50
【问题描述】:
我想使用模块 WWWW::Wunderground::API 来使用 JSON 下载带有天气的数据。
这是我的 PERL 脚本:
use WWW::Wunderground::API;
my $wun = new WWW::Wunderground::API(location=>'KIAD', api_key=>'my key');
print 'JSON source:'.$wun->json if $wun->api_type eq 'json';
它给了我一个错误:
不能祝福非参考价值在 /usr/local/share/perl5/Hash/AsObject.pm 第 82 行。
我无法修复它。我一直在尝试更新 cpan 和其他模块,但它没有给出任何结果。
你能告诉我如何修理它吗?
提前谢谢你
与 Carp::Always:
不能祝福非参考价值在 /usr/local/share/perl5/Hash/AsObject.pm 第 82 行 Hash::AsObject::AUTOLOAD('Hash::AsObject', undef) 调用于 /usr/local/share/perl5/WWW/Wunderground/API.pm 第 37 行 WWW::Wunderground::API::update('WWW::Wunderground::API=HASH(0x1e5b178)', 'KIAD') 在 /home/xyz/workspace/WeatherTest/scr.pl 第 4 行调用 eval {...} 在 /home/xyz/workspace/WeatherTest/scr.pl 行调用 4
【问题讨论】:
-
查看堆栈跟踪可能很有用。添加
use Carp::Always;并再次运行。 -
我添加了 Carp::Always 并且我已经编辑了我的帖子
标签: json perl bless wunderground