AW: <<Spam-Verdacht>> warning message: DBI->connect using 'old-style' syntax is deprecated and will be an error in future versions at blib/lib/invlib.pm line 20
Selke, Gisbert W. <Gisbert.Selke <at> wido.bv.aok.de>
2006-01-06 14:51:02 GMT
> -----Ursprüngliche Nachricht-----
> Von: John Chambers [mailto:JLChambers <at> klikwood.com]
> Gesendet: Freitag, 6. Januar 2006 15:39
> A few weeks ago, I upgraded an old Debian system to Sarge, and I started
> receiving these error messages:
> DBI->connect using 'old-style' syntax is deprecated and will
> be an error in future versions at blib/lib/invlib.pm line 20
> in my apache logs.
> Now, I'm building a newer system from scratch, and when I
> make test my local modules, I'm getting that message.
> The scripts still work, but I prefer no warnings
Good idea.
> What is the new syntax? Here is my call:
> (my $dbh = DBI->connect( 'sheet', 'jc', 'secret', 'mysql' ) ) or die
> "Cannot do \$dbh->connect: $DBI::errstr\n";
A very brief look into the DBI docs reveals:
$dbh = DBI->connect($data_source, $username, $password)
or die $DBI::errstr;
$dbh = DBI->connect($data_source, $username, $password, \%attr)
or die $DBI::errstr;
[...]
Examples of $data_source values are:
dbi:DriverName:database_name
dbi:DriverName:database_name <at> hostname:port
dbi:DriverName:database=database_name;host=hostname;port=port
[...]
For compatibility with old DBI scripts, the driver can be specified by
(Continue reading)