For what you are trying to do, you should turn it into a module. Sorry for 
the short post, I've gotta split...

Although it's not user friendly, my more constructive hint is to type 
perldoc perlmod to get a quick tutorial on writing a module.

At 06:56 PM 8/1/2001 -0400, Philip Mak wrote:
>I have a CGI application where I do:
>
>require 'db.pl';
>
>where db.pl defines some functions and variables related to connecting to
>the database, and then executes C<$dbh = DBI->connect(...)>.
>
>I tried to convert this application to modperl, but I ran into the problem
>that require did not execute db.pl again the second time I called the
>script, so that the C<$dbh = DBI->connect(...)> line was not executed.
>
>I can get around this by changing C<require> to C<do>, but is that the
>"correct" way of doing things? It seems a waste to redefine all the
>subroutines and variables again. But I do need it to reinitialize $dbh
>when C<require 'db.pl';> is called.
>
>What should I do?

__________________________________________________
Gunther Birznieks ([EMAIL PROTECTED])
eXtropia - The Open Web Technology Company
http://www.eXtropia.com/

Reply via email to