update logging to take errors from perl -e better