On Mon, Jul 23, 2001 at 05:17:10PM -0500, [EMAIL PROTECTED] wrote:
> chdir("$www") or die "Cant change directory to /www.\n";

I found this somewhat confusing.  You have a variable, $www, but this is the
only time you use it.  Everywhere else you use "/www".  You should probably
pick one.

Oh, and the quotes are unnecessary.  chdir($www) works just fine, and is
preferred.


> my @webhost = glob("*");
> chdir("$dir") or die "Cant change directory to the control panel.\n";

No quotes necessary, chdir($dir).  You may want consider changing it to:

  chdir($dir) or die "Can't change directory to \"$dir\": \l$!.\n";

This will ease your debugging if something goes wrong with the chdir.


> my @controlpanel = glob("*");
> 
> if ($htaccess) {
>   for my $i(@webhost) {
>     if (( -d "/www/$i" ) && ( $i ne "lost+found" ) && ( $i ne "DEFUNCT" ))
> {
>       htaccess($i);
>     }
>   }
> }
> 
> sub htaccess {
> my $fqdn = shift;
> 
> my $fqdn_i = (split(/\./, $fqdn))[-2];
> 
> open(FH,">/www/$fqdn/controlpanel/.htaccess") or die "Cant open
> .htaccess for $fqdn : $!\n";
> 
> print FH <<HTA; ######################### LINE 152
> AuthUserFile /etc/htsec/$fqdn_i.ht

$fqdn_i is the only variable you have that could cause an uninitialized
value warning.  Your split line above must have returned only one element,
causing the index into it to return undef.  $fqdn must not be what you think
it should be.


> AuthName "Hosting Administration"
> AuthType Basic
> require valid-user
> HTA
> 
> close(FH);
> }


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to