Subject: | DBI synopsis lists MySQL example instead of DBI example |
Date: | Wed, 11 Jan 2012 07:22:39 -0700 |
To: | bug-Net-Google-SafeBrowsing2 [...] rt.cpan.org |
From: | Ben <datatap [...] gmail.com> |
Hi thanks for your great module but I'm having trouble getting it to use
DBI.
First I noticed on this page and in the actual file you give the wrong
synopsis example, it's for MYSQL instead of DBI:
http://search.cpan.org/~jsobrier/Net-Google-SafeBrowsing2-1.04/lib/Net/Google/SafeBrowsing2/DBI.pm
SYNOPSIS ^
use Net::Google::SafeBrowsing2::MySQL;
my $storage = Net::Google::SafeBrowsing2::MySQL->new(host => '127.0.0.1',
database => 'GoogleSafeBrowsingv2');
...
$storage->close();
I went ahead and tried using this, figuring it might work:
my $storage = Net::Google::SafeBrowsing2::DBI->new(file =>
'google-v2.db');
but my script is giving the error:
Can't call method "selectall_arrayref" on an undefined value at
/usr/local/lib/p erl5/site_perl/5.8.9/Net/Google/SafeBrowsing2/DBI.pm line
463.
Some more information:
perl -v
This is perl, v5.8.9 built for amd64-freebsd
And the full code of my script is:
----------------------------------------------------------------------
#!/usr/bin/perl
use Net::Google::SafeBrowsing2;
use Net::Google::SafeBrowsing2::DBI;
$apikey="........................";
$dbfile = "google-v2.db";
my $storage = Net::Google::SafeBrowsing2::DBI->new(file => $dbfile);
my $gsb = Net::Google::SafeBrowsing2->new(
key => $apikey,
storage => $storage,
);
$gsb->update();
----------------------------------------------------------------------
Thanks for any help you can give.
Ben