Add logging to perl script