A simple log in Perl

23 September 2008
by Gavin Colborne

I know this is really easy but I get asked it so often, I thought I would note it down.
The best way to create a log file from Perl is to use log4perl, but it has a bit of a learning curve so try the simple approach for now which is as follows:

open (LOG, ">C:InterwovenTeamsitelocallogsmystuffdebug.log");
     print LOG "Starting Program...n";
close LOG;

Anything you wish to write to the log, simply use the ‘print’ statement and you are away 🙂

Our Latest News