//A simple log in Perl

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 🙂

By |2008-09-23T23:58:43+00:00September 23rd, 2008|Perl|0 Comments

About the Author: