in reply to is there something wrong with this code?

There's something wrong with the code in principle: as in, hit counters are bad -- you should be grepping the logs instead, and even those are wrong because of proxies and caching.

But specifically, this code:

open( LOG, ">/home/exposu/logs/web_access.log.txt" ) || die "$!\n";
makes this a "one hit wonder". {grin} Each new hit overwrites the previous file instead of appending it. Change your > to a >> there.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: •Re: is there something wrong with this code?
by emcb (Beadle) on May 18, 2002 at 21:33 UTC
    I realiased this and hit back to change it and re-submit after preview, but it did'nt work. And im ashamed that i left out the '-w'! Sorry the open has the '>>' but i cant edit it now, or can i?