Oh, a retro-site! Webcounters are so mid 1990's!

I got to ask you, why do you think people are interested in seeing an up-to-date count of, uhm, yeah, what actually? Certainly not the count of visitors, as such counters don't count hits served from proxies. Or let me phrase that another way. What goes through your mind if you visit a web page, and it says you are visitor 123456 since some point in the past? Do you get thrilled? Do you keep a diary where you write down your score? Do you even read it?

Anyway, your program is riddles with problems. It might work well if you get just a handful of requests, distributed over the day. But you a have a problem each and every time you have two hits almost simultaneously.

If you really must include a counter, does it have to be up-to-date to the second? Why don't you just generate the entire page, including a new count, every night? You can get the count from your log files.

Abigail
-- 
You are visitor 1,578,920,023 since the third month of the 15th year of the reign of Ramses II.


In reply to Re: Need a way to print script output to web page? by Abigail-II
in thread Need a way to print script output to web page? by Elijah

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.