package mylog; use strict; use Data::Dumper; open LOGFILE, ">log.txt"; sub log { print LOGFILE, Dumper @_; } sub END { close LOGFILE; } #now in your main proggie &mylog::log("This is a logged message");
There are many better variations, but this is a good first module.
____________________
Jeremy
I didn't believe in evil until I dated it.
In reply to Re: How to write to log files?
by jepri
in thread How to write to log files?
by ajt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |