Image based counter
#!/usr/local/bin/perl
use CGI;
$co = new CGI;
open (COUNT, "<count.dat")
or die "Could not open counter data file.";
$count = <COUNT>;
close COUNT;
$image = int($count / 10) % 10;
open (IMAGE, "<$image.gif");
$size = -s "$image.gif";
read IMAGE, $data, $size;
close IMAGE;
print
$co->header(-type=>'image/gif'),
$data;
Related examples in the same category