Hit Counter

I'm curious how I would create a web counter using perl/cgi...

Anyone have any suggestions?

I don't need anything fancy, don't care about IP checking...

Thanks!
rockies1Asked:
Who is Participating?
 
holliConnect With a Mentor Commented:
use Fcntl qw(:DEFAULT :flock);

sysopen (FH, "counter.dat", O_RDWR | O_CREAT, O666) or die "cannot write to counter: $!";
flock (FH, LOCK_EX) or die "flock-error: $!"; #lock the file

#read counter data here, increase it and write it back to file here

flock (FH, LOCK_UN) or die "flock-error: $!"; # unlock the file

close FH;



0
 
kplonkCommented:
Do you have access to a data base to hold the counst or gust files on your server
0
 
MoondancerCommented:
Please update/finalize this question.

Thanks,

Moondancer
Community Support Moderator @ Experts Exchange
0
 
Computer101Commented:
Comment from expert accepted as answer.

Thank you
Computer101
E-E Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.