Hi, all: 

Anyone has read <<MySQL and Perl for the Web>> by Paul DuBois?

I used a startup file in my Apache web server as follows (nearly same as
written in that book at
page 78). 

----------------------------------------------------------------------------
-----------------
use strict;
use CGI(); 
CGI->compile(':all');
use DBI();
use DBD::mysql();
1;      # return true; 
----------------------------------------------------------------------------
-----------------

I name this startup file as "startup.pl", and put it under the folder
"conf", and I add 
into the httpd.conf file a line as "PerlRequire conf/startup.pl"

and my script (named "select_user.pl" in cgi-perl) is as follows: 

----------------------------------------------------------------------------
-----------------
use WebDB;
my($dbh, $user);
$dbh = WebDB::connect();
#$dbh = WebDB::connect_with_option_file();
$user = $dbh->selectrow_array ("SELECT USER()");
print header(), start_html("Select User");
print p("You connected as $user\n");
print end_html(); 
$dbh->disconnect();
exit(0);
----------------------------------------------------------------------------
-----------------

But gives me an error like: 

[Fri Aug 15 13:43:53 2003] [error] Undefined subroutine
&Apache::ROOT::cgi_2dperl::select_user_2epl::header called at (eval 149)
line 8.

Line 8 is the line where "print end_html();" lies. 

Anything wrong here? 

thanks, 

Regards,
Xu Qiang
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to