# ... DBI stuff ... grab row with binary datatype $parent_hex = '0x0' . unpack("H*",$row->{parentid});