Hello,
I've written a simple script to capture web hits that match a certain criteria (e.g., referrer contains "google") and write those to a separate log file. That file grows pretty big and every now and then I want to purge it and keep only, say, the last 100 rows. I was going to do this with something like:
tail -100 logfile.txt > logfile.txt
But for some reason this just gives me an empty logfile.
Any thoughts on a clean way to do this in Perl?
Thanks
I've written a simple script to capture web hits that match a certain criteria (e.g., referrer contains "google") and write those to a separate log file. That file grows pretty big and every now and then I want to purge it and keep only, say, the last 100 rows. I was going to do this with something like:
tail -100 logfile.txt > logfile.txt
But for some reason this just gives me an empty logfile.
Any thoughts on a clean way to do this in Perl?
Thanks