invalid byte sequence for encoding “UTF8″: 0×8b - storing binary data

This error message took me lots of effort and time to solve it. The problem is that before storing binary data strings in the postgresql database the binary strings need to be escaped before storing them. There is on the google available subroutine for per which is doing this job. It is called escape_bytea. Anyway [...]

Create and install linux debian package for missing perl module with dh-make-perl

Sometimes you encounter situation when you need a perl module to support your program but perl module is not available from standard linux repositories. Installing perl module from source code is not always good idea so what would be the best is to create package for a particular module using dh-make-perl command. In my case [...]

Perl script code example to create temporary file-tempfile()

Here is a perl script example how to create temporary file on the file system:
TEMPLATE DIR AND SUFIX are option !

#!/usr/bin/perl
my $tempfile = new File::Temp ( TEMPLATE => ‘tempfile_XXX’, DIR => ‘/tmp/’, SUFIX => ” );

this will create a temporary file in /tmp/ directory with name tempfile_XXX where X is random generated character.