--- loncom/configuration/Configuration.pm 2003/04/12 02:45:31 1.10 +++ loncom/configuration/Configuration.pm 2004/04/01 15:26:04 1.12 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Configuration file reader # -# $Id: Configuration.pm,v 1.10 2003/04/12 02:45:31 foxr Exp $ +# $Id: Configuration.pm,v 1.12 2004/04/01 15:26:04 albertel Exp $ # # # Copyright Michigan State University Board of Trustees @@ -34,7 +34,7 @@ package LONCAPA::Configuration; -$VERSION = sprintf("%d.%02d", q$Revision: 1.10 $ =~ /(\d+)\.(\d+)/); +$VERSION = sprintf("%d.%02d", q$Revision: 1.12 $ =~ /(\d+)\.(\d+)/); use strict; @@ -43,28 +43,24 @@ my $confdir='/etc/httpd/conf/'; # ------------------- Subroutine read_conf: read LON-CAPA server configuration. # This subroutine reads PerlSetVar values out of specified web server # configuration files. -sub read_conf - { +sub read_conf { my (@conf_files)=@_; my %perlvar; - foreach my $filename (@conf_files,'loncapa_apache.conf') - { + foreach my $filename (@conf_files,'loncapa_apache.conf') { open(CONFIG,'<'.$confdir.$filename) or die("Can't read $confdir$filename"); - while (my $configline=) - { - if ($configline =~ /^[^\#]*PerlSetVar/) - { + while (my $configline=) { + if ($configline =~ /^[^\#]*PerlSetVar/) { my ($unused,$varname,$varvalue)=split(/\s+/,$configline); chomp($varvalue); $perlvar{$varname}=$varvalue; - } - } + } + } close(CONFIG); - } + } my $perlvarref=\%perlvar; return ($perlvarref); - } +} #---------------------- Subroutine read_hosts: Read a LON-CAPA hosts.tab # formatted configuration file. @@ -94,7 +90,7 @@ sub read_hosts { { my @list = @items; # probably not needed but I'm unsure of # about the scope of item so... - $HostsTab{@list[0]} = \@list; + $HostsTab{$list[0]} = \@list; } } }