use Data::Dumper; my $placeHolder1 = 20; my $sql = 'SELECT *.... where blablabla = ?'; my $sth = $dbh->prepare( $sql ) or die "Error in preparing SQL: $DBI::errstr\nSQL: $sql\n\n"; $sth->execute( $placeHolder1 ) or die "Error in executing SQL: ", $sth->errstr, "\n"; while( my $data = $sth->fetchrow_hashref ) { print Dumper( $data ); } # while $sth->finish;