hey hey!
I keep getting this error when I try to print the results of my database query:
[tt]Global symbol "$row" requires explicit package name at script1.pl line 13.
Global symbol "$row" requires explicit package name at script1.pl line 14.
Global symbol "$row" requires explicit package name at script1.pl line 15.
Global symbol "$row" requires explicit package name at script1.pl line 15.
Execution of script1.pl aborted due to compilation errors.[/tt]
It's just a simple script, but I'm a newbie, so I really don't know what the problem is, I've been working on it for a while... Here the code:
I'm using ActivePerl perl, v 5.6.1 built for MSWin32-x86-multi-thread, Binary build 630,
DBI 1.20
DBD:ODBC 0.28
Apache 1.3.20 (Win32)
MS Access 2000 (9.0.3821) SR-1
I've looked around, and can't find a FAQ or thread or anything to help me, but if one exists, just point me in the right direction! Thanks!!
-Kasey
I keep getting this error when I try to print the results of my database query:
[tt]Global symbol "$row" requires explicit package name at script1.pl line 13.
Global symbol "$row" requires explicit package name at script1.pl line 14.
Global symbol "$row" requires explicit package name at script1.pl line 15.
Global symbol "$row" requires explicit package name at script1.pl line 15.
Execution of script1.pl aborted due to compilation errors.[/tt]
It's just a simple script, but I'm a newbie, so I really don't know what the problem is, I've been working on it for a while... Here the code:
Code:
#!C:/perl/bin/perl -w
use DBI;
use strict;
my $database = "dmhc01";
my $data_source = "DBI:ODBC:$database";
my $dbh = DBI->connect($data_source)
or die "Can't connect to $data_source";
my $sth = $dbh->prepare("select id, age from invent4 where ctn like '%weymouth%'")
or die "Can't prepare sql statement";
$sth->execute ||
die "Could not execute SQL statement";
$row = $sth->fetchrow_hashref;
while ($row=$sth->fetchrow_hashref)
{print "id: $row->{id}\t
age: $row->{age}\n"}
exit(0);
I'm using ActivePerl perl, v 5.6.1 built for MSWin32-x86-multi-thread, Binary build 630,
DBI 1.20
DBD:ODBC 0.28
Apache 1.3.20 (Win32)
MS Access 2000 (9.0.3821) SR-1
I've looked around, and can't find a FAQ or thread or anything to help me, but if one exists, just point me in the right direction! Thanks!!
-Kasey