--- loncom/interface/lonsearchcat.pm 2001/11/29 20:33:28 1.108 +++ loncom/interface/lonsearchcat.pm 2001/12/11 02:18:13 1.109 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.108 2001/11/29 20:33:28 harris41 Exp $ +# $Id: lonsearchcat.pm,v 1.109 2001/12/11 02:18:13 harris41 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -103,39 +103,39 @@ sub BEGIN { { my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}. '/language.tab'); - map { + while (<$fh>) { $_=~/(\w+)\s+([\w\s\-]+)/; chomp; $language{$1}=$2; - } <$fh>; + } } $cprtag{'any'}='Any copyright/distribution'; { my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonIncludes'}. '/copyright.tab'); - map { + while (<$fh>) { $_=~/(\w+)\s+([\w\s\-]+)/; chomp; $cprtag{$1}=$2; - } <$fh>; + } } $mimetag{'any'}='Any type'; { my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}. '/filetypes.tab'); - map { + while (<$fh>) { $_=~/(\w+)\s+(\w+)\s+([\w\s\-]+)/; chomp; $mimetag{$1}=".$1 $3"; - } <$fh>; + } } { my $fh=Apache::File->new($Apache::lonnet::perlvar{'lonTabDir'}. '/hosts.tab'); - map { + while (<$fh>) { $_=~/(\w+?)\:(\w+?)\:(\w+?)\:(.*)/; chomp; if ($3 eq 'library') { $hostdomains{$1}=$2; $hostips{$1}=$4; } - } <$fh>; + } } } @@ -376,21 +376,21 @@ ENDDOCUMENT # ----------- grab unprocessed CGI variables that may have been appended to URL sub get_unprocessed_cgi { - map { + foreach (split(/&/,$ENV{'QUERY_STRING'})) { my ($name, $value) = split(/=/,$_); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; if ($name eq 'catalogmode' or $name eq 'launch' or $name eq 'acts') { $ENV{'form.'.$name}=$value; } - } (split(/&/,$ENV{'QUERY_STRING'})); + } } # ------------------------------------------------------------- make persistent sub make_persistent { my $persistent=''; - map { + foreach (keys %ENV) { if (/^form\./ && !/submit/) { my $name=$_; my $key=$name; @@ -400,7 +400,7 @@ sub make_persistent { END } - } (keys %ENV); + } return $persistent; } @@ -580,11 +580,11 @@ sub selectbox { my $uctitle=uc($title); my $selout="\n

$uctitle:". "
".''; } @@ -1506,14 +1506,14 @@ RESULTS # --------- settings whenever the user causes the search window to be launched sub start_fresh_session { delete $hash{'mode_catalog'}; - map { + foreach (keys %hash) { if ($_ =~ /^pre_/) { delete $hash{$_}; } if ($_ =~ /^store/) { delete $hash{$_}; } - } keys %hash; + } } 1;