in reply to Templatize Repeated code

Log::Log4perl is a very powerful log framework. You will still need 2-3 lines of code in each script to initialize it, but you can keep the log configuration in a single file for all your scripts.
--
Andreas