Subject: | DBIx-Dump |
This is the error that I get when I run the perl script below. I am tring to write to an excel file. Let me know what I am doing wrong.
Version of Modules That Are Installed
DBI 1.37
DBIx-Dump 0.04
DBD-mysqlPP 0.03
SpeadSheet-WriteExcel 0.42
ERRORS:
Filename required by Spreadsheet::WritExcel->new() at D:/Perl/site/lib/DBIx/Dump.pm line 48
(in cleanup) Cant use an undefind value as a HASH reference at D:/Perl/site/lib/Spreadsheet/WriteExcel/Workbook.pm line 553.
Cant call method addworksheet on an undefined value at D:/Perl/site/lib/DBIx/Dump.pm line 51.
Here is a copy of my perl script.
#!D:/perl/bin/perl
use DBI;
use Spreadsheet::WriteExcel;
use DBIx::Dump;
### Perform the connection using the Mysql Driver.
my $dbh = DBI->connect("DBI:mysqlPP:database=db1;host=localhost", "root","mysql")
or die "Can't make connect to the database: $DBI::errstr\n";
my $sql=("select * from table1");
$sth = $dbh->prepare($sql);
$sth->execute();
$out = DBIx::Dump->new('format' => 'excel',
'ouput' => 'db.xls',
'sth' => $sth,);
$out->dump();
$dbh->disconnect or warn "Disconnect failed: $DBI::errstr\n";
exit;
OPERATIONS SYSTEM
Windows 2000 Server.