in reply to insert & retrieve images from DB to web

did you try my $rawdata = pack 'H*', $data; to convert the hex string to raw data?

I think that should work. $data is twice as long as $blob because two hexadecimal characters represent one byte. Each byte is a character in $blob because it is raw data and not a string.

The GIF 89a string is the beginning of the file header for GIF and comes before the binary data, so that is what you want to end up with in $rawdata above.