http://qs321.pair.com?node_id=188636


in reply to Sharing Configuration between Multiple CGI Scripts (was: How difficult can)

The result of using CGI::Carp was that the config.pm file did not return a true value even though I had a:

1;

line at the end. I then changed the line to:

return 1;

and all worked fine. Is this a requirement of Perl 5.006? or should one always use:

return 1;

Thanks for the CGI::Carp suggestion, we did not have access to the error logs.

Replies are listed 'Best First'.
Re: Re: Sharing Configuration between Multiple CGI Scripts (was: How difficult can)
by valdez (Monsignor) on Aug 08, 2002 at 17:25 UTC

    Yes, you need always to return 1 from modules. Please read man perlmod, particularly the section about Perl Modules.

    Ciao, Valerio

Re: Re: Sharing Configuration between Multiple CGI Scripts (was: How difficult can)
by perrin (Chancellor) on Aug 08, 2002 at 18:35 UTC
    You should not need to say "return 1;". Just putting a "1;" at the end of the file should be enough. Maybe you have something after the "1;", like some POD? If you put POD at the end, you would typically put the "__END__" marker before it.
      Nope, I had only 1; at the end and it won't work, though I might have had a line return.
        You have something else wrong then, since a 1 at the end is the standard suggested way to do this. Maybe something else in your module causes it to return before it hits that 1 at the end.