Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Module Errors

Status
Not open for further replies.

job357

Technical User
Sep 16, 2002
106
US
Greetings:

I am teaching myself PERL, but ran into this problem when executing a script from the tutorial:

System: WIN32
OS: WIndows 2000

Script:

use warnings;
use strict;
use DBI;

my ($dbh, $sth);

$dbh=DBI->connect('dbi:mysql:test', 'root', 'password')
die "Error opening database: $DBI::errstr\n";

$sth=$dbh->prepare("CREATE TABLE checkin (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
firstname VARCHAR(32) NOT NULL,
lastname VARCHAR(32) NOT NULL,
checkedin INTEGER,
numberofbags INTEGER,
destination VARCHAR(32) NOT NULL)" );

$sth=execute();

$sth->finish();
print "All done\n";
$dbh->disconnect || die "Failed to disconnect\n";

Error:

Undefined subroutine &main::execute called at create.pl line 18.

Thanks!

 
I think you mean
$sth->execute(), not
$sth=execute()
 
Thanks,
That did it, wonder why perl -cw script.pl did n ot detect it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top