OOP Perl and CGI Methods -- Any Known Problems?
From: Ron Wingfield (rtwingfield_at_archaxis.net)
Date: 12/26/04
- Next message: Ron Wingfield: "selectrow_array functions seems to die???"
- Previous message: Darren Duncan: "ignore this - testing new email connection"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: <dbi-users@perl.org> Date: Sun, 26 Dec 2004 15:26:18 -0600
I have tried experiments as many of you have suggested, but I just can't get the
use DBI;
use CGI;
$cgi= new CGI;
eval "require $database";
etc.
scenario to connect to a database. Oddly, I have been unexpectly succssful with a connection constructed as follows in the function-based (i.e., non-OOP Perl) environment as follows:
use CGI qw(:standard escapeHTML);
my $dbh=Cookbook::connect();
This accomplishes a "wholesale" connection without any regard for $localhost, $userid or $passwd. Apparently, the spelling, "Cookbook", is irrelevant, because the name of the database is actually "cookbook" (from Paul DuBois' book, MySQL Cookbook, O'Reilly, 2003.). This actually surprises me because the connection does not specify the $userid, $passwd, or $localhost information.
Now that I have invested a day converting a Perl forms program from functional to OOP methods, the simple connect example does not connect. There must be some little wiggle that I'm just not "getting". It also seems like the "die" constructs do not work, either -- the program execution just seems to blow right past 'em. Are there any known problems with the versions of Perl, MySQL, etc. that I'm using? (see my signature)
Thanks again and OTTF,
Ron Wingfield
FreeBSD 4.8 -- Apache http 2.0.28 -- MySQL client/server 4.1.7
Perl 5.8.5 -- p5-DBD-mysql-2.9004 driver -- p5-DBI-1.46
--------------------------------------------------------------------------------
- Next message: Ron Wingfield: "selectrow_array functions seems to die???"
- Previous message: Darren Duncan: "ignore this - testing new email connection"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|