Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Sharing Configuration between Multiple CGI Scripts (was: How difficult can)

by belize (Deacon)
on Aug 08, 2002 at 16:29 UTC ( [id://188636]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://188636]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-25 15:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found