nbierman has asked for the wisdom of the Perl Monks concerning the following question:
When I run the script I get the "Hello" message, and 2 perl messages. Can't use string ("1") as a HASH ref while "strict refs" in use at ../strawberry/perl/site/lib/DBI.pm line 560. DBI->connect using 'old-style' syntax is deprected and will be in error in future versions at DBITest.prl line 24. I'm not too concerned about the syntax message, but obviously the first message is a showstopper. Can somebody help me out with the message from DBI.pm and, if possible, point me to some documentation on the 'new-style' syntax? Thanks#! /usr/bin/perl use DBI; use strict; use warnings; print "Hello.\n"; my $dsn = 'dbi:Oracle:sid=ORCL'; my $user = 'MyID'; my $password = 'MyPWD'; my $dbh = DBI->connect($dsn,$user,$password,RaiseError => 1, AutoCommi +t => 0) || die "Database connection failed: $DBI::errstr"; print "Database connection succeeded.\n"; $dbh->disconnect(); print "Bye, bye ;-)\n"; exit
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error messages from DBI (\%attr)
by kyle (Abbot) on Jun 12, 2008 at 16:42 UTC | |
by nbierman (Novice) on Jun 12, 2008 at 17:00 UTC | |
by radiantmatrix (Parson) on Jun 12, 2008 at 20:37 UTC |