[Add a -w to this]
> #!/usr/bin/perl -w
> ####################################
> # Setup begin
>
[and a strict pragma]
use strict;
> $homepage = "/home/yourdomain/counter/";
>
> $counterfile = "$homepage counter.txt"; #Full file path of counter.txt
>
[I don't think you really want a hash here. Unless there's something else
going on, if you have an array that's just indexed by sequencial integers
you'll do much better with a plain old array.]
for $i (0 .. 9) $imagefile[$i] = "$homepage $i.gif";
[or, if you want some syntactic sugar]
@imagefile = map {"$homepage $_.gif"} (0..9);
> $imagefile{'0'}="$homepage 0.gif"; #Full file path of 0.gif
> $imagefile{'1'}="$homepage 1.gif"; #Full file path of 1.gif
> $imagefile{'2'}="$homepage 2.gif"; #Full file path of 2.gif
...
The '-w' and 'use strict' will go a long way to keeping you out of trouble.
Good Luck,
Peter C.