I use this on a couple of my CGI scripts... I just use sed thus in the perl code:
`sed -i '1i $var1 $var2 $var3' /path/to/log/log.txt`;
If you use this, the file MUST not be empty to start with, so I just put at the top the date the log was created. It also adds the new entry at the top. Nick P.S. ummm, for some reason the code tags fail here...
|