in reply to $self->do_it("now") question

Check the OO modules that are being loaded with the use ...; statement.

One of them should have a do_it method or should inherit it from a parent or ancestor class.

Replies are listed 'Best First'.
Re^2: $self->do_it("now") question
by packetstormer (Monk) on Jul 21, 2015 at 14:14 UTC

    Yeah, I did! It really doesn't exist. I've even searched the whole system for that text and got no hits apart from the pm file it's called from - very strange

    grep "do_it" ./ -ir
      very strange

      Not really; it's fairly normal in a dynamic language like Perl. Like choroba already said, sub names can be autoloaded or dynamically created. Note how in the following two examples, there is no obvious (greppable) place that do_it is defined.

      sub AUTOLOAD { print "Hello!\n" } do_it(); __END__ Hello!
      my $x = "do_"; my $y = "it"; { no strict 'refs'; *{"$x$y"} = sub { print "Hello!\n" }; } do_it(); __END__ Hello!

      It very well could be that a module is doing some strange symbol table hackery with the call and transforming it into something that doesn't even remotely resemble the name 'do_it'. Your best bet is the debugger...

      Besides the possibility, mentioned by other monks, of dynamically created method names and other symbol table hacking or some other form of black magic, I do not think that your grep is sufficient even for straight forward OO modules, because it looks only into the current directory and its sub-directory tree. Perl modules can be installed in other places. You should also look into the directories listed in the @INC array and their subdirectories.