in reply to DBD::Oracle - RAW datatypes
sub fixRaw(\$) { my $raw = shift; return undef unless defined $raw and defined $$raw; ################################################################## # Split the raw into 2 byte chunks, interpret each chunk as hex, # then pack it! ################################################################## return join('',map(pack('C', hex($_)), $$raw =~ /../sg)); # The below also works... I don't know which is fastest. # return join('',map(pack('C', hex($_)), unpack("a2"x(length($$raw +)/2),$$raw))); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: DBD::Oracle - RAW datatypes
by Anonymous Monk on Apr 11, 2014 at 14:48 UTC |