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

raeburn raeburn at source.lon-capa.org
Wed Dec 10 20:56:35 EST 2014


raeburn		Thu Dec 11 01:56:35 2014 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  - Coding style: sort() keys() split()
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.503 loncom/interface/lonnavmaps.pm:1.504
--- loncom/interface/lonnavmaps.pm:1.503	Tue Nov 18 03:33:53 2014
+++ loncom/interface/lonnavmaps.pm	Thu Dec 11 01:56:34 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.503 2014/11/18 03:33:53 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.504 2014/12/11 01:56:34 raeburn Exp $
 
 #
 # Copyright Michigan State University Board of Trustees
@@ -2117,7 +2117,7 @@
     $self->{PARM_CACHE} = {};
     
     my %parm_hash = {};
-    foreach my $key (keys %big_hash) {
+    foreach my $key (keys(%big_hash)) {
 	if ($key =~ /^param\./) {
 	    my $param_key = $key;
 	    $param_key =~ s/^param\.//;
@@ -2190,7 +2190,7 @@
     my %lastread = &Apache::lonnet::dump('nohist_'.$cid.'_discuss',
                                         $self->{DOMAIN},$self->{USERNAME},'lastread');
     my %lastreadtime = ();
-    foreach my $key (keys %lastread) {
+    foreach my $key (keys(%lastread)) {
         my $shortkey = $key;
         $shortkey =~ s/_lastread$//;
         $lastreadtime{$shortkey} = $lastread{$key};
@@ -4874,7 +4874,7 @@
 		    }
 		}
 	    }
-	    my @sortedParts = sort keys %parts;
+	    my @sortedParts = sort(keys(%parts));
 	    $self->{PARTS} = \@sortedParts;
         }
         
@@ -4895,13 +4895,13 @@
         # So we have to use our knowlege of part names to figure out 
         # where the part names begin and end, and even then, it is possible
         # to construct ambiguous situations.
-        foreach my $data (split /,/, $metadata) {
+        foreach my $data (split(/,/, $metadata)) {
             if ($data =~ /^([a-zA-Z]+)response_(.*)/
 		|| $data =~ /^(Task)_(.*)/) {
                 my $responseType = $1;
                 my $partStuff = $2;
                 my $partIdSoFar = '';
-                my @partChunks = split /_/, $partStuff;
+                my @partChunks = split(/_/, $partStuff);
                 my $i = 0;
                 for ($i = 0; $i < scalar(@partChunks); $i++) {
                     if ($partIdSoFar) { $partIdSoFar .= '_'; }
@@ -5645,7 +5645,7 @@
     my $self = shift;
     my @branches;
     my $from = $self->from();
-    foreach my $branch ( split /,/, $from) {
+    foreach my $branch ( split(/,/, $from)) {
         my $choice = $self->{NAV_MAP}->getById($branch);
         my $prev = $choice->comesfrom();
         $prev = $self->{NAV_MAP}->getById($prev);




More information about the LON-CAPA-cvs mailing list