我目前遇到的问题是在本地计算机上显示perl cgi脚本浏览器(http://localhost:8080/Monitoring/www/user_status.xml.pl?user=xxxxxx)。因为它是第一次安装Perl,所以我知道可能会缺少库,所以我通过将所需的" pm" s拉到我的本地机器(来自公司Ubuntu服务器,其中cgi运行正常)来弥补它重新启动Apache以获取最新的修复程序。所有看起来都很好,因为我通过"无法找到......"问题直到我坚持下面的问题。
The 'pattern' parameter (undef) to DateTime::Format::Strptime::new was an 'undef', which is not one of the allowed types: scalar scalarref
at C:\xampp\htdocs\Monitoring\lib/Params/ValidatePP.pm line 653.
Params::Validate::__ANON__("The 'pattern' parameter (undef) to DateTime::Format::Strptime"...) called at C:\xampp\htdocs\Monitoring\lib/Params/ValidatePP.pm line 497
Params::Validate::_validate_one_param(undef, HASH(0x26e646c), HASH(0x26e68d4), "The 'pattern' parameter (undef)") called at C:\xampp\htdocs\Monitoring\lib/Params/ValidatePP.pm line 356
Params::Validate::validate(ARRAY(0x26e8b24), HASH(0x26e6514)) called at C:\xampp\htdocs\Monitoring\lib/DateTime/Format/Strptime.pm line 131
DateTime::Format::Strptime::new(undef, "pattern", undef) called at C:\xampp\htdocs\Monitoring\lib/Geo/DateTime.pm line 47
require Geo/DateTime.pm called at C:/xampp/htdocs/Monitoring/www/user_status.xml.pl line 10
main::BEGIN() called at C:\xampp\htdocs\Monitoring\lib/Geo/DateTime.pm line 0
eval {...} called at C:\xampp\htdocs\Monitoring\lib/Geo/DateTime.pm line 0
Compilation failed in require at C:/xampp/htdocs/Monitoring/www/user_status.xml.pl line 10.
BEGIN failed--compilation aborted at C:/xampp/htdocs/Monitoring/www/user_status.xml.pl line 10.
在我看来,Perl库存在内部问题并抱怨自己的代码。在Google上进行了搜索,无法找到有关标题中描述的问题的任何解决方案/建议。并不像我一样缺席图书馆问题。
任何人都知道这里有什么问题,我该怎么做才能解决它?
干杯 戴尔
答案 0 :(得分:1)
在C:\xampp\htdocs\Monitoring\lib\Geo\DateTime.pm
的第47行,您可以获得与以下内容相同的内容:
DateTime::Format::Strptime::new(undef, "pattern", undef)
这揭示了两个错误:
new
称为子例程而不是方法(因为调用者未定义)。