I am working on a cgi and i'm new to perl. could someone please check to see if i did
this right?
below is code for a program. as you can see it is going to take a lot of editing.
#!/usr/bin/perl
####################################
# Setup begin
$counterfile = "/home/yourdomain/counter/counter.txt"; #Full file path of counter.txt
$imagefile{'0'}="/home/yourdomain/counter/0.gif"; #Full file path of 0.gif
$imagefile{'1'}="/home/yourdomain/counter/1.gif"; #Full file path of 1.gif
$imagefile{'2'}="/home/yourdomain/counter/2.gif"; #Full file path of 2.gif
$imagefile{'3'}="/home/yourdomain/counter/3.gif"; #Full file path of 3.gif
$imagefile{'4'}="/home/yourdomain/counter/4.gif"; #Full file path of 4.gif
$imagefile{'5'}="/home/yourdomain/counter/5.gif"; #Full file path of 5.gif
$imagefile{'6'}="/home/yourdomain/counter/6.gif"; #Full file path of 6.gif
$imagefile{'7'}="/home/yourdomain/counter/7.gif"; #Full file path of 7.gif
$imagefile{'8'}="/home/yourdomain/counter/8.gif"; #Full file path of 8.gif
$imagefile{'9'}="/home/yourdomain/counter/9.gif"; #Full file path of 9.gif
#Setup end
############################
my idea was to substitute a variable so only one edit is needed
#!/usr/bin/perl
####################################
# Setup begin
$homepage = "/home/yourdomain/counter/";
$counterfile = "$homepage counter.txt"; #Full file path of counter.txt
$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
$imagefile{'3'}="$homepage 3.gif"; #Full file path of 3.gif
$imagefile{'4'}="$homepage 4.gif"; #Full file path of 4.gif
$imagefile{'5'}="$homepage 5.gif"; #Full file path of 5.gif
$imagefile{'6'}="$homepage 6.gif"; #Full file path of 6.gif
$imagefile{'7'}="$homepage 7.gif"; #Full file path of 7.gif
$imagefile{'8'}="$homepage 8.gif"; #Full file path of 8.gif
$imagefile{'9'}="$homepage 9.gif"; #Full file path of 9.gif
#Setup end
############################
I bet there is even a way to use something the Basic for/next command on this!