Counter

The Graphical Counter (v1.1.1) generated dynamic hit counter images using the FLY graphics library, displaying visitor counts as customizable digit images.

Perl v1.1.1 FLY Graphics Legacy

Quick Info

  • Version: 1.1.1
  • Released: April 25, 1996
  • Era: 1990s Classic
  • Language: Perl 5+
  • Requires: FLY Graphics Library
  • License: Free for use

Overview

Counter creates a graphical hit counter in-lined into your page without Server Side Includes. Unlike text-based counters, this script generates actual images showing your page hit count using customizable digit graphics.

Key Features

  • Graphical digit display using customizable digit images
  • No Server Side Includes required
  • Access logging with detailed visitor information
  • Referer validation for security
  • Customizable frame and transparency options
  • HTML formatted log viewer included

Package Contents

counter.plMain counter program
count.txtCounter data file
access_logVisitor access log
error_logError log file
html_log.plHTML log formatter
bad_referer.gifError image

Historical Context

The CGI Script Archive Era

Counter was released on April 25, 1996 as part of Matt Wright's Script Archive. Unlike text-based counters, it used the FLY program (an interface to the GD graphics library) to generate GIF images of digit sequences on the fly. This allowed webmasters to display graphical visitor counts without Server Side Includes.

Why Hit Counters Mattered

Before server-side analytics tools existed, hit counters were the primary way to measure website traffic. Visible counters also served as social proof — advertisers in the late 1990s priced ad placements based on reported page views, and a high counter number signaled an active site.

The Decline of Hit Counters

Server-side analytics (Urchin, then Google Analytics in 2005) made client-visible counters redundant. Bots and crawlers inflated counts, making the numbers unreliable, and professional web design moved away from displaying raw traffic figures.

Fun Fact

Some websites in the 1990s initialized their counters at arbitrary high numbers (like 100,000) to appear more popular. This practice was widespread enough to become a running joke in web design circles.

Modern Alternatives

Modern analytics tools replaced visible hit counters. The options below range from privacy-focused to full-featured:

Privacy-Focused Analytics

Plausible Analytics

Lightweight, privacy-friendly analytics. Script is 75x smaller than Google Analytics. GDPR compliant, no cookies required.

From $9/mo Open Source Self-hostable
Umami

Open source, easy-to-use Google Analytics alternative. Free tier available, easy self-hosting with Docker.

Free Tier Open Source Next.js
Fathom Analytics

Simple, privacy-first analytics. No cookies, GDPR compliant. Canadian company with strong privacy focus.

From $14/mo SaaS Only

Full-Featured Analytics

Google Analytics 4

Industry standard with powerful features. Free for most sites. Requires cookie consent in EU.

Free Requires Consent
Matomo (Piwik)

Powerful open source analytics platform. Full Google Analytics feature parity. Self-hosted or cloud.

Open Source Self-hostable Cloud from €19/mo
GoatCounter

Simple, privacy-aware counter. Free for non-commercial use. Shows a visible counter if desired!

Free (non-commercial) Open Source

Simple Visible Counters (Retro Style)

StatCounter

Free visible counter with detailed stats. Still supports classic counter images.

Free
Counter.dev

Privacy-focused, open source counter. Simple embed, no tracking.

Free
Free Hit Counter

Classic style hit counters with various digit designs.

Free

Comparison: Then vs Now

Feature 1996 Counter Modern Analytics
Data collectedPage views onlyViews, sessions, paths, events
User identificationIP onlyCookies or cookieless hashing
Real-time dataNoYes
Geographic dataNoCountry, city, region
Device infoNoBrowser, OS, screen size
Referrer trackingBasicFull attribution
Server requirementsPerl + GD/FLYJavaScript snippet
Privacy complianceN/AGDPR, CCPA options
CostFree (self-hosted)Free to $50+/mo

Installation (Legacy)

Step 1: Install FLY

The FLY program provides an interface to the GD graphics library. It compiles on SunOS, OSF 3.2, and most Unix systems.

Step 2: Upload Files

  • counter.pl → CGI-bin directory
  • count.txt → Data directory (writable)
  • Digit images (0.gif - 9.gif) → Images directory

Step 3: Set Permissions

chmod 755 counter.pl
chmod 666 count.txt
chmod 666 access_log

Step 4: Configure Variables

Edit counter.pl and set paths, referer validation, and display options.

Step 5: Add to Your Page

<!-- Basic usage -->
<img src="/cgi-bin/counter.pl" alt="Visitor Counter">

<!-- As background (creative use!) -->
<body background="/cgi-bin/counter.pl">

Configuration Options

Variable Description Example
$basedir Base directory for counter files /home/user/counter/
$count_file File storing the count count.txt
$digit_dir Directory with digit images /images/digits/
$fly_path Path to FLY executable /usr/local/bin/fly
@referers Allowed referer domains ('yourdomain.com')
$log_access Enable access logging 1 (on) or 0 (off)

Download

Download the Counter script package:

Additional Resources

Frequently Asked Questions

Common issues include:

  • FLY not installed: The script requires the FLY graphics library
  • Permissions: Ensure counter.pl is executable (755) and count.txt is writable (666)
  • Path issues: Check that all paths in configuration are correct
  • Referer check: Your domain must be in the @referers array

In the 1990s, sites like GifWorks offered thousands of animated digit sets. Today you can:

  • Search for "counter digits GIF" on archive.org
  • Create your own using any graphics program
  • Use CSS counters for a modern approach

Visible counters persist for several reasons:

  • Retro design: Some sites use visible counters as a design element
  • Transparency: Shows visitors you track minimal data
  • Social proof: Popular blogs still benefit from visible counts
  • Simplicity: Services like GoatCounter make it easy

Modern analytics tools are more practical for production use:

  • They provide richer data (sessions, paths, referrers, geography)
  • Privacy-focused options (Plausible, Umami) require only a JS snippet
  • The FLY library is difficult to find and compile on modern systems
  • Server-side image generation per request adds unnecessary load

This script is preserved as a reference implementation.

FeatureCounterTextCounter
OutputGIF imagePlain text/SSI
RequirementsFLY + GDPerl only
CustomizationDigit imagesCSS styling
Server loadHigherLower

View All FAQs | Counter FAQ Archive

Related Scripts

TextCounter Perl

Simple text-based counter using SSI. No graphics library required.

Book 'em Dan-O Perl

Visitor logging without visible counter. Tracks detailed access info.

Guestbook Perl

Let visitors leave comments on your site.

Counter Examples

See modern analytics alternatives and implementation guides.

Back to Scripts TextCounter