PDA

View Full Version : $dbh->quote(...) where does this module come from??? I need to find the package


Relative0
05-03-2007, 10:49 PM
Hello,

I am running Perl/CGI scripts and I keep getting an error for the $dbh->quote(...) function. The error looks as such:

Can't call method "quote" on an undefined value at anindex.cgi line 1920.

Furthermore it says:

[Thu May 3 15:38:04 2007] anindex.cgi: Can't call method "quote" on an undefined value at anindex.cgi line 1920.
Compilation failed in require at anindex.cgi line 874.

if ($sc_shall_i_log_errors eq "yes")
{
$file = $dbh->quote($file); #1920


foreach $require_file (@require_files)
{
if (-e "$require_file" && -r "$require_file") { #874
require "$require_file";

I believe this tells me that I do not have the Module which contains the quote() method installed. Does this sound like it might be the case? If it is the case well I don't know where to find this quote function. What does it come with? I have seen some references to Ruby and PEAR. Might this be a Method in those? I have looked some and could not find definitions for all of the Methods so I don't know. Please let me know if you might be familiar with this method. If it is not where might it be?

Thanks Kindly,

Brian

FishMonger
05-03-2007, 11:54 PM
You haven't shown enough of the script to say for sure, but it's a very good bet that the quote method it's referring to is from the DBI module. The error message is telling you that the $dbh database handle isn't defined.
http://search.cpan.org/~timb/DBI-1.54/DBI.pm

Also, that's a clunky method for handing the require statements.