perlmovabletype

Got an error: Undefined subroutine &Scalar::Util::looks_like_number called


I have a site using Movable Type, and when trying to upload a picture to a post, the error showed up, and now the admin area only shows blank pages with that error message.

I read on a blog post in Japanese (via Google translate) and it mentions the mt-wizard.cgi, but I couldn't understand how to fix it.

Is is something that needs to be installed in the server? Any ideas of where I could possibly start?


Solution

  • The looks_like_number subroutine needs to be included in your script.

    #!/usr/bin/perl
    #use Scalar::Util qw(looks_like_number);
    
    if ( Scalar::Util::looks_like_number("a") ) {
      print "Look like a number!\n";
    } else {
      print "No\n";
    }
    

    When the use Scalar::Util qw(looks_like_number); is commented out, you'll get that error.

    Undefined subroutine &Scalar::Util::looks_like_number called at main.pl line 4.
    

    Find the file that is giving you the error and add the use statement to it to include that subroutine and it should get you past that error at least.