#!/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 =<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?