DanielSpaniel has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I've been playing around trying to get a very simple crawler working, using the module Mojolicious and Mojo::UserAgent. However, I keep getting an error message which I don't know how to resolve, per below:

Mojo::Reactor::Poll: I/O watcher failed: Can't locate object method "is_status_class" via package "Mojo::Message::Response" at crawler.pl line 57.

The code is identical to several examples I've seen, and I've tried the script with "use Mojolicious;" and also "use Mojo::UserAgent", both of which work, but each of which fails with the same error. I've only just installed the modules, so I assume I have the most recent versions. I've also re-installed everything too.

I'm running this on a CentOS machine, with Perl v5.16.3.

Any assistance would be much appreciated. I've scoured the web, but I've yet to find any fix.

Many thanks!

Replies are listed 'Best First'.
Re: Mojolicious Problem
by marto (Cardinal) on Nov 20, 2017 at 17:51 UTC

      Ah, I see. Thank you. I'll investigate what the new is_success method does and see if I can get that working.

      Later ...

      Yeah, okay; I got it working now using the new methods which are available:

      http://mojolicious.org/perldoc/Mojo/Message/Response

      Thanks for your help.

        Glad that was of some help. The Changes is a great place to check, Mojolicious has had several changes of significance, and a lot of the tutorials/examples from a few years ago posted on the interwebs no longer work with a modern Mojo install.