Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
My current code (hack) is adding spaces to the beginning of each line.
Thanks for any replies...open (LOG,"log.dat"); @logfile = <LOG>; close(LOG); @old_logfile = @logfile[0..100]; open (LOG,">log.dat"); flock(LOG,2); print LOG "$date - $requesturi - ($httpuseragent) $remorehost: $remote +port ($remoteaddr) - $httpreferer\n"; print LOG "@old_logfile"; flock(LOG,8); close(LOG);
update (broquaint): title change (was How do I trauncate a flat file, then append to front?)
|
|---|