hubb0r has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl -w use strict; use DBI; my $user = $ARGV[0]; my $pass = $ARGV[1]; my $dbh = DBI->connect('DBI:mysql:database=test;host=localhost', $user, $pass, { RaiseError => 1, AutoCommit => 1, PrintError => 1, } ); my $create_sql =<<SQL; CREATE TEMPORARY TABLE IF NOT EXISTS test_situation (id int, data +int) SQL $dbh->do($create_sql); my $sql = "SELECT * FROM test_situation WHERE id = ?"; my $sth = $dbh->prepare($sql); ## Notice array does not even contain element that I reference: my $href = { foo => 1, bar => 2, baz => 3, }; $sth->execute($href->{'id'}); ## Shouldn't this throw a warning?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Warnings not being thrown with DBI
by pg (Canon) on Sep 11, 2005 at 00:33 UTC | |
|
Re: Warnings not being thrown with DBI
by jZed (Prior) on Sep 11, 2005 at 00:15 UTC | |
by Anonymous Monk on Sep 11, 2005 at 00:39 UTC | |
by ikegami (Patriarch) on Sep 11, 2005 at 04:19 UTC | |
by tye (Sage) on Sep 11, 2005 at 06:04 UTC | |
by ikegami (Patriarch) on Sep 11, 2005 at 16:07 UTC | |
by tye (Sage) on Sep 11, 2005 at 17:48 UTC | |
| |
by Anonymous Monk on Sep 11, 2005 at 06:11 UTC |