my $dbh = DBI->connect($db{$dsn}{dsn},$db{$dsn}{user},$db{$dsn}{password},$db{$dsn}{opts}); if (!defined($dbh)) { print "Error creating dbh: " . $DBI::errstr . "\n"; exit; } my $sth; $sth = $dbh->prepare($query); if (!$sth) { print "Error: " . $dbh->errstr . "\n"; exit; } if (!$sth->execute) { print "Error: " . $sth->errstr . "\n"; exit; } print "Content-Type: text/html; charset=utf-8\n\n"; my $ref = $sth->fetchrow_arrayref; my $str = $$ref[0]; print $db{$dsn}{driver}." ".$str ." > ".join(" ",map {sprintf("0x%X",$_)} unpack("C*",$str))."\n";