in reply to Re^4: mod_perl debugging help
in thread mod_perl debugging help

Is there anything else on the server that uses the 'FormGenerator' namespace?

It's WAY too generic. If some other CGI running under mod_perl uses that namespace, when your script runs, it'll see that a module with that name is loaded, and not bother loading anything. You'll then get strange error messages about functions not found.

(or worse, they both use the same subroutines names, and you end up with odd behaviour that is almost impossible to track down on larger systems)

Replies are listed 'Best First'.
Re^6: mod_perl debugging help
by MiggyMan (Sexton) on Jun 23, 2006 at 13:05 UTC
    The only other thing in that namespace are the subordinate modules.

    And as for the name, I do plan to devise a less generic name for it however for the time being FormGenerator fits, tis one of those "does what it says on the tin" names, consider it a development name :)

      You might think so, but you're the one asking for help here, and have said you're not sure what's going on.

      I'd suggest looking for occurances of 'FormGenerator' in every perl module and mod_perl file that you have, and make sure you're correct.

      Or, if you don't want to go to that trouble, switch every occurance that you know should be 'FormGenerator' to something more specific. After all, if you have multiple people working on a system, someone else might've thought that 'FormGenerator' made a good 'development name' as well, or you might've done it months/years ago, and forgotten you still had a file sitting around.

      Because you can declare a package in ANY file, it is very, very, easy for the problem I've describe to occur if you're sloppy in your naming. (and I speak from experience.) Mod_perl is much, much less forgiving than a simple CGI.

      ps. 'paint' makes a good label for a can -- but it's not of much use when you're specifically looking for white semigloss latex paint

        I already have done :)

        the many joys of find ./ -type f -exec grep -l "FormGenerator" "{}" ";" :p

        It did occour to me that it might be something like that, I've also recently made a modification so that the base module is now FormGenerator::Base just in case it was suffering from mod_perl's module loading order quirk (since FormGenerator::List is normaly accessed first) but that came up blank :(