The easiest way is to include it the output of the counter program within an iFrame in your page:
<iframe width="100" height="40" id="counter" src="/cgi-bin/counter"></iframe>
(Change height and width to suit. Anything between the tags will be displayed in really ancient browsers that don't support iframes -- if anybody is still using those browsers in real life anymore.)
A more elaborate way involves having your script generate not text, but an image -- then you can call it up with an <img /> tag. For this to work, you will probably need an additional Perl module to interface to some library like GD or ImageMagick -- search and read the docs.
<iframe width="100" height="40" id="counter" src="/cgi-bin/counter"></iframe>
(Change height and width to suit. Anything between the tags will be displayed in really ancient browsers that don't support iframes -- if anybody is still using those browsers in real life anymore.)
A more elaborate way involves having your script generate not text, but an image -- then you can call it up with an <img /> tag. For this to work, you will probably need an additional Perl module to interface to some library like GD or ImageMagick -- search and read the docs.