Solved

Hit Counter

Posted on 2001-07-26
4
182 Views
Last Modified: 2013-12-25
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!
0
Comment
Question by:rockies1
4 Comments
 
LVL 6

Accepted Solution

by:
holli earned 100 total points
ID: 6324654
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
 

Expert Comment

by:kplonk
ID: 6328658
Do you have access to a data base to hold the counst or gust files on your server
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6699405
Please update/finalize this question.

Thanks,

Moondancer
Community Support Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Computer101
ID: 6903909
Comment from expert accepted as answer.

Thank you
Computer101
E-E Moderator
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you get a (Blue Screen of Death), your system writes a small file called a minidump. Your first step is to make certain your computer is setup to record memory dumps. Right click My Computer, choose properties. Click on the advanced tab, an…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now