[LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm

harris41 lon-capa-cvs@mail.lon-capa.org
Sat, 02 Mar 2002 03:50:28 -0000


harris41		Fri Mar  1 22:50:28 2002 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  map to foreach
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.23 loncom/interface/lonfeedback.pm:1.24
--- loncom/interface/lonfeedback.pm:1.23	Wed Jan 16 10:38:38 2002
+++ loncom/interface/lonfeedback.pm	Fri Mar  1 22:50:27 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.23 2002/01/16 15:38:38 www Exp $
+# $Id: lonfeedback.pm,v 1.24 2002/03/02 03:50:27 harris41 Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -260,24 +260,27 @@
   }
   if ($ENV{'form.question'}) {
     $typestyle.='Submitting as Question<br>';
-    map {
+    foreach (split(/\,/,
+		   $ENV{'course.'.$ENV{'request.course.id'}.'.question.email'})
+	     ) {
       $to{$_}=1;
-    } split(/\,/,
-	    $ENV{'course.'.$ENV{'request.course.id'}.'.question.email'});
+    } 
   }
   if ($ENV{'form.course'}) {
     $typestyle.='Submitting as Comment<br>';
-    map {
+    foreach (split(/\,/,
+		   $ENV{'course.'.$ENV{'request.course.id'}.'.comment.email'})
+	     ) {
       $to{$_}=1;
-    } split(/\,/,
-	    $ENV{'course.'.$ENV{'request.course.id'}.'.comment.email'});
+    } 
   }
   if ($ENV{'form.policy'}) {
     $typestyle.='Submitting as Policy Feedback<br>';
-    map {
+    foreach (split(/\,/,
+		   $ENV{'course.'.$ENV{'request.course.id'}.'.policy.email'})
+	     ) {
       $to{$_}=1;
-    } split(/\,/,
-	    $ENV{'course.'.$ENV{'request.course.id'}.'.policy.email'});
+    } 
   }
   return ($typestyle,%to);
 }
@@ -286,7 +289,7 @@
   my ($feedurl,$email,$citations,%to)=@_;
   my $status='';
   my $sendsomething=0;
-  map {
+  foreach (keys %to) {
     if ($_) {
       my $declutter=&Apache::lonnet::declutter($feedurl);
       unless (&Apache::lonmsg::user_normal_msg(split(/\:/,$_),
@@ -296,7 +299,7 @@
 	$sendsomething++;
       }
     }
-  } keys %to;
+  }
 
     my %record=&Apache::lonnet::restore('_feedback');
     my ($temp)=keys %record;
@@ -360,7 +363,7 @@
 
 # --------------------------- Get query string for limited number of parameters
 
-    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;
@@ -369,7 +372,7 @@
               $ENV{'form.'.$name}=$value;
 	   }
        }
-    } (split(/&/,$ENV{'QUERY_STRING'}));
+    }
 
   if (($ENV{'form.hide'}) || ($ENV{'form.unhide'})) {
 # ----------------------------------------------------------------- Hide/unhide