[LON-CAPA-cvs] cvs: rat / lonsequence.pm

raeburn raeburn at source.lon-capa.org
Sun Dec 14 19:46:52 EST 2014


raeburn		Mon Dec 15 00:46:52 2014 EDT

  Modified files:              
    /rat	lonsequence.pm 
  Log:
  - Coding style:
   - keys()
   - for readability eliminate use of $_
  
  
Index: rat/lonsequence.pm
diff -u rat/lonsequence.pm:1.44 rat/lonsequence.pm:1.45
--- rat/lonsequence.pm:1.44	Thu Nov 28 02:23:25 2013
+++ rat/lonsequence.pm	Mon Dec 15 00:46:52 2014
@@ -2,7 +2,7 @@
 #
 # Sequence Handler
 #
-# $Id: lonsequence.pm,v 1.44 2013/11/28 02:23:25 raeburn Exp $
+# $Id: lonsequence.pm,v 1.45 2014/12/15 00:46:52 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -133,13 +133,13 @@
                 .'</p><br />');
     }
     my $idx=0;
-    foreach (&attemptread(&Apache::lonnet::filelocation('',$url))) {
-	if (defined($_)) {
+    foreach my $entry (&attemptread(&Apache::lonnet::filelocation('',$url))) {
+	if (defined($entry)) {
             $idx++;
             if ($successtied) { 
 		$r->print('<form name="form'.$idx.'">');
             }
-	    my ($title,$url)=split(/\:/,$_);
+	    my ($title,$url)=split(/\:/,$entry);
 	    $title = &LONCAPA::map::qtescape($title);
 	    unless ($title) { $title=(split(/\//,$url))[-1] };
             my $enc_title = &HTML::Entities::encode($title,'\'"<>&');
@@ -184,12 +184,12 @@
 
 # ----------------------------------------------------------- Clean out selhash
 sub start_fresh_session {
-    foreach (keys %selhash) {
-	if ($_ =~ /^pre_/) {
-	    delete $selhash{$_};
+    foreach my $item (keys(%selhash)) {
+	if ($item =~ /^pre_/) {
+	    delete $selhash{$item};
 	}
-	if ($_ =~ /^store/) {
-	    delete $selhash{$_};
+	if ($item =~ /^store/) {
+	    delete $selhash{$item};
 	}
     }
 }




More information about the LON-CAPA-cvs mailing list