in reply to Re: silent failure with non-existant module
in thread silent failure with non-existant module

use strict and use warnings was used in the module, but it did not catch the error. Perl did not warn be in any way, it just stopped executing at an unrelated place.

Can't exporting functions lead to problems with more than one function having the same name? This code is part of program that already is quite large.

Sorry about the title. Forgot to change it when I read through the post.

  • Comment on Re^2: silent failure with non-existant module

Replies are listed 'Best First'.
Re^3: silent failure with non-existant module
by imp (Priest) on Oct 17, 2006 at 14:10 UTC
    Perl will die with an error if a method that does not exist is called, unless there is an AUTOLOAD method.

    Note that dying will not result in output to stderr or the program terminating if it is contained in an eval block. Perhaps this is happening in your case?

    For more help we will need a bit more code to work with, but please keep it to the minimum working implementation that demonstrates the error. Reduce it to the simplest form that still behaves in the undesired way and you will usually find the problem, otherwise post it here.

      CGI::Application traps all errors using eval, but these errors are forwared to an error handling function. This does not happen in this case.

      I have tried to recreate the problem in a small enough example, but all my attempts has failed. Instead of recreating the bug, Perl behaves as expected and protests about a undefined subroutine when reaching the statement WrongModuleName::func()

      This leads me to believe that the error with the wrong is package name is not the real error, but a sympton of something else. I have no idea of what can cause such a problem in Perl. In C/C++ my best guess would be some pointer errors, but as far as I understand, Perl should not suffer from such problems.

      I will post more information if I find out any more.