http://www.perlmonks.org?node_id=581926

Sprad has asked for the wisdom of the Perl Monks concerning the following question:

I'm using DBI with the ODBC driver. In my DB, I have some hex values. I'd dearly like to leave them as hex values. Unfortunately, when I extract them, DBI assumes they're some sort of binary data and converts them to text.

For example, the hex string "0x5061756c" becomes the ASCII string "Paul". This is a documented feature of DBI, so the fact that it's doing this doesn't surprise me. What I'm wondering, though, is can I turn it off? I'd rather get the hex string as a literal "0x" followed by the literal hex digits.

---
A fair fight is a sign of poor planning.