0

I'm currently running into an issue getting perl cgi script browser display on my local machine (http://localhost:8080/Monitoring/www/user_status.xml.pl?user=xxxxxx). As it was a first install of Perl I understand there might be missing libraries so I make it up by pulling the required "pm"s across to my local machine (from company Ubuntu server where the cgi runs fine) and restart Apache to pick up the latest fixes. All looks fine as I work through "Can't Locate ..." problems until I stuck on the following issue.

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.

Looks to me like the Perl libraries are having internal issues and complaining on its own code. Did a search on Google, couldn't find any resolution / suggestions around the issue described in the Title. And doesn't look to me like a missing libraries problem.

Anyone know what is the problem here and what can I do to fix it?

Cheers Dale

ikegami
  • 367,544
  • 15
  • 269
  • 518
dale
  • 439
  • 3
  • 11
  • 28
  • 1
    Looks to me like you passed `undef` as the `pattern` parameter to `DateTime::Format::Strptime::new`. – Matt Jacob Nov 12 '15 at 02:01
  • Thanks Matt, what you said does remind me of something I changed that makes my local perl script different to the one on server. I'll revert it back and see how it goes. Thanks – dale Nov 12 '15 at 04:58
  • 1
    We could probably provide more accurate help if you post the actual code. – Matt Jacob Nov 12 '15 at 05:04

1 Answers1

1

At line 47 of C:\xampp\htdocs\Monitoring\lib\Geo\DateTime.pm, you have something equivalent to the following:

DateTime::Format::Strptime::new(undef, "pattern", undef)

This reveals two bugs:

  1. You called new as a subroutine rather than as a method (since the invocant is undefined).
  2. You provided an incorrect value for the pattern.
ikegami
  • 367,544
  • 15
  • 269
  • 518