develooper Front page | perl.beginners | Postings from May 2019

can I use some kind of binary string?

Thread Next
May 10, 2019 17:10
can I use some kind of binary string?
Message ID:


I would like to use curl to retrieve an image from a web server which I 
want to store in a table in a mariadb database without downloading the 
image to a file.  For this application, I do not want to store 
references to files stored in some file system instead.

So I would want to use something like

my $binary_data = `curl -k ""`;

The image then needs to be inserted into a LONGBLOB field via DBI in 
such a way that the image can be restored as it was.

Will string conversions or something prevent this from working?

What is the usual way to do this?  It is certainly not ideal to have no 
check on the amount of data that might be retrieved from the web server, 
regardless whether I save it to an intermediate file or not.

To make things more difficult, the web server is using a self-signed 

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About