--- loncom/configuration/Configuration.pm 2003/07/22 19:21:10 1.11 +++ 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.11 2003/07/22 19:21:10 matthew 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.11 $ =~ /(\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.