Many thanks for your help. The script is now working fine save for one snag. the script is supposed to post items to respective files but it is not doing so. The folders are created by the script. The posting are recorded but they reside outside of the folder. I do not know in what area the script has gone wrong. Is it because of error in base path? There is also another problem. The script is not writing to some files. The script write permission is set to 0777. Is it wrong?? I will be thankful for any help. Amitava Adam Witney wrote: > this error is because you shouldn't use 'my' more than once on the same > variable in the same block of code > > go through the code and remove any extra 'my' declarations of the same > variable > > adam > > > > > I have some problem with the following subroutine > > and in spite of my best effort I failed to solve > > it. I am getting the following error… > > > > Besides, does unix file permission 0777 work on Mac. > > The 2.1 server showing error writing permission > > > > Thanks > > > > Amitava > > ############################################################# > > > > # "my" variable $key masks earlier declaration in same > > scope. > > File 'Untitled'; Line 39 > > # "my" variable $key masks earlier declaration in same > > scope. > > File 'Untitled'; Line 60 > > # "my" variable $key masks earlier declaration in same > > scope. > > File 'Untitled'; Line 74 > > # "my" variable $key masks earlier declaration in same > > scope. > > File 'Untitled'; Line 87 > > ############################################################# > > > > > > > > sub dispcat { > > > > print "<center><font size=\"+2\">Welcome to > > $config{'sitename'}</font>"; > > print "<table border=\"2\" bordercolor=\"#000000\" > > bgcolor=\"#FF9933\" cellspacing=\"0\" cellpadding=\"0\" > > width=\"100\%\"><tr><td> </td></tr></table><br>"; > > print "<TABLE WIDTH=600 BORDER=1 > > bordercolor=$config{'colortableborder'} > > BGCOLOR=$config{'colortablebody'} cellspacing=0 > > cellpadding=0><TR><TD ALIGN=CENTER Valign=top>\n"; > > ################ <---------------------COPY HERE TO END > > COPY TO ADD ANOTHER row of CATEGORYs > > ------------>####################### > > > > > > print "<TABLE WIDTH=200 BORDER=0 > > bordercolor=$config{'colortableborder'} cellspacing=0 > > cellpadding=0 bgcolor=$config{'colortablebody2'}>\n"; > > print "<TR><TD colspan=2 ALIGN=CENTER > > BGCOLOR=$config{'colortablehead'}><B><A > > HREF=$ENV{'SCRIPT_NAME'}?action=1>Main Category > > 1</a></B></TD></TR>"; > > my $key; > > foreach $key (sort keys %Cats1) { > > umask(000); > > mkdir("$config{'basepath'}$key", 0777) unless (-d > > "$config{'basepath'}$key"); > > opendir DIR, "$config{'basepath'}$key" or &oops("Category > > directory $key could not be opened."); > > my $numfiles = scalar(grep -T, map > > "$config{'basepath'}$key/$_", readdir DIR); > > closedir DIR; > > print "<TR><TD><B><A > > HREF=$ENV{'SCRIPT_NAME'}?category=$key>$category{$key}</a></B></td><td > > align=center>$numfiles</td></TR> "; > > } > > print "</TABLE></td>\n"; > > > > > > print "<td align=center valign=top><TABLE WIDTH=200 > > BORDER=0 bordercolor=$config{'colortableborder'} > > cellspacing=0 cellpadding=0 > > bgcolor=$config{'colortablebody2'}>\n"; > > print "<TR><TD colspan=2 ALIGN=CENTER > > BGCOLOR=$config{'colortablehead'}><B><A > > HREF=$ENV{'SCRIPT_NAME'}?action=2>Main Category > > 2</a></B></TD></TR>"; > > ###############my $key; > > foreach $key (sort keys %Cats2) { > > umask(000); > > mkdir("$config{'basepath'}$key", 0777) unless (-d > > "$config{'basepath'}$key"); > > opendir DIR, "$config{'basepath'}$key" or > > &oops("Category directory $key could not be opened."); > > my $numfiles = scalar(grep -T, map > > "$config{'basepath'}$key/$_", readdir DIR); > > closedir DIR; > > print "<TR><TD><B><A > > HREF=$ENV{'SCRIPT_NAME'}?category=$key>$category{$key}</a></B></td><td > > align=center>$numfiles</td></TR> "; > > } > > print "</TABLE>\n"; > > > > print "<td align=center valign=top><TABLE WIDTH=200 > > BORDER=0 bordercolor=$config{'colortableborder'} > > cellspacing=0 cellpadding=0 > > bgcolor=$config{'colortablebody2'}>\n"; > > print "<TR><TD colspan=2 ALIGN=CENTER > > BGCOLOR=$config{'colortablehead'}><B><A > > HREF=$ENV{'SCRIPT_NAME'}?action=3>Main Category > > 3</a></B></TD></TR>"; > > my $key; > > foreach $key (sort keys %Cats3) { > > umask(000); > > mkdir("$config{'basepath'}$key", 0777) unless (-d > > "$config{'basepath'}$key"); > > opendir DIR, "$config{'basepath'}$key" or > > &oops("Category directory $key could not be opened."); > > my $numfiles = scalar(grep -T, map > > "$config{'basepath'}$key/$_", readdir DIR); > > closedir DIR; > > print "<TR><TD><B><A > > HREF=$ENV{'SCRIPT_NAME'}?category=$key>$category{$key}</a></B></td><td > > align=center>$numfiles</td></TR> "; > > } > > print "</TABLE>"; > > > > > > > > > > ################ <--------------------- END CUT HERE TO ADD > > ANOTHER row of CATEGORYs > > ------------>####################### > > print "</td></tr><tr><td valign=top>"; > > ################ <---------------------COPY HERE TO END > > COPY TO ADD ANOTHER row of CATEGORYs > > ------------>####################### > > > > > > print "<TABLE WIDTH=200 BORDER=0 > > bordercolor=$config{'colortableborder'} cellspacing=0 > > cellpadding=0 bgcolor=$config{'colortablebody2'}>\n"; > > print "<TR><TD colspan=2 ALIGN=CENTER > > BGCOLOR=$config{'colortablehead'}><B><A > > HREF=$ENV{'SCRIPT_NAME'}?action=4>Main Category > > 4</a></B></TD></TR>"; > > my $key; > > foreach $key (sort keys %Cats4) { > > umask(000); > > mkdir("$config{'basepath'}$key", 0777) unless (-d > > "$config{'basepath'}$key"); > > opendir DIR, "$config{'basepath'}$key" or &oops("Category > > directory $key could not be opened."); > > my $numfiles = scalar(grep -T, map > > "$config{'basepath'}$key/$_", readdir DIR); > > closedir DIR; > > print "<TR><TD><B><A > > HREF=$ENV{'SCRIPT_NAME'}?category=$key>$category{$key}</a></B></td><td > > align=center>$numfiles</td></TR> "; > > } > > print "</TABLE></td>\n"; > > > > > > print "<td align=center valign=top><TABLE WIDTH=200 > > BORDER=0 bordercolor=$config{'colortableborder'} > > cellspacing=0 cellpadding=0 > > bgcolor=$config{'colortablebody2'}>\n"; > > print "<TR><TD colspan=2 ALIGN=CENTER > > BGCOLOR=$config{'colortablehead'}><B><A > > HREF=$ENV{'SCRIPT_NAME'}?action=5>Main Category > > 5</a></B></TD></TR>"; > > my $key; > > foreach $key (sort keys %Cats5) { > > umask(000); > > mkdir("$config{'basepath'}$key", 0777) unless (-d > > "$config{'basepath'}$key"); > > opendir DIR, "$config{'basepath'}$key" or > > &oops("Category directory $key could not be opened."); > > my $numfiles = scalar(grep -T, map > > "$config{'basepath'}$key/$_", readdir DIR); > > closedir DIR; > > print "<TR><TD><B><A > > HREF=$ENV{'SCRIPT_NAME'}?category=$key>$category{$key}</a></B></td><td > > align=center>$numfiles</td></TR> "; > > } > > print "</TABLE>\n"; > > > > print "<td align=center valign=top><TABLE WIDTH=200 > > BORDER=0 bordercolor=$config{'colortableborder'} > > cellspacing=0 cellpadding=0 > > bgcolor=$config{'colortablebody2'}>\n"; > > print "<TR><TD colspan=2 ALIGN=CENTER > > BGCOLOR=$config{'colortablehead'}><B><A > > HREF=$ENV{'SCRIPT_NAME'}?action=6>Main Category > > 6</a></B></TD></TR>"; > > my $key; > > foreach $key (sort keys %Cats6) { > > umask(000); # UNIX file permission junk > > mkdir("$config{'basepath'}$key", 0777) unless (-d > > "$config{'basepath'}$key"); > > opendir DIR, "$config{'basepath'}$key" or > > &oops("Category directory $key could not be opened."); > > my $numfiles = scalar(grep -T, map > > "$config{'basepath'}$key/$_", readdir DIR); > > closedir DIR; > > print "<TR><TD><B><A > > HREF=$ENV{'SCRIPT_NAME'}?category=$key>$category{$key}</a></B></td><td > > align=center>$numfiles</td></TR> "; > > } > > print "</TABLE>"; > > > > > > > > > > ################ <--------------------- END CUT HERE TO ADD > > ANOTHER row of CATEGORYs > > ------------>####################### > > > > print "</table><TABLE WIDTH=550 BORDER=0 > > bordercolor=$config{'colortableborder'} cellspacing=0 > > cellpadding=0><TR>"; > > print "<TD width=40 align=right><font color=\"#ff0000\" > > size=\"-1\">$no_user </font></td><td width=130><font > > size=\"-1\">Registered Users</font></td>"; > > print "<TD width=40 align=right><font color=\"#ff0000\" > > size=\"-1\">$no_post </font></td><td width=100><font > > size=\"-1\">Items Posted</font></td>"; > > print "<TD width=40 align=right><font color=\"#ff0000\" > > size=\"-1\">$no_viewed </font></td><td width=80><font > > size=\"-1\">Page Views</font></td>"; > > print "<TD width=40 align=right><font color=\"#ff0000\" > > size=\"-1\">$no_bids1 </font></td><td width=80><font > > size=\"-1\">Bids > > Placed</font></td></tr></table></CENTER>\n"; > > print "<BR><table border=\"2\" bordercolor=\"#000000\" > > bgcolor=\"#FF9933\" cellspacing=\"0\" cellpadding=\"0\" > > width=\"100\%\"><tr><td> </td></tr></table>"; > > > > } > > > > > > > > ==== Want to unsubscribe from this list? > > ==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org > > ==== Want to unsubscribe from this list? > ==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org ==== Want to unsubscribe from this list? ==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org