[LON-CAPA-cvs] cvs: loncom /imspackages imsimport.pm

raeburn raeburn at source.lon-capa.org
Wed Dec 10 20:07:38 EST 2014


raeburn		Thu Dec 11 01:07:38 2014 EDT

  Modified files:              
    /loncom/imspackages	imsimport.pm 
  Log:
  - Coding style: sort() keys()
  
  
Index: loncom/imspackages/imsimport.pm
diff -u loncom/imspackages/imsimport.pm:1.45 loncom/imspackages/imsimport.pm:1.46
--- loncom/imspackages/imsimport.pm:1.45	Mon Sep 30 17:42:12 2013
+++ loncom/imspackages/imsimport.pm	Thu Dec 11 01:07:38 2014
@@ -1,6 +1,6 @@
 # The LearningOnline Network with CAPA
 # 
-# $Id: imsimport.pm,v 1.45 2013/09/30 17:42:12 bisitz Exp $
+# $Id: imsimport.pm,v 1.46 2014/12/11 01:07:38 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -378,16 +378,16 @@
                             $tempdir,\%resources,\%items,\%hrefs,\%resinfo,
                             'choose',\%includedres,\%includeditems);
         if ($manifest_result eq 'ok') {
-            foreach my $res (sort keys %resources) {
+            foreach my $res (sort(keys(%resources))) {
                 if ($cms eq 'bb5' || $cms eq 'bb6' || $cms eq 'webctce4' 
                     || $cms eq 'webctvista4') {
-                    foreach my $area (keys %{$$cmsmap{$cms}}) {
+                    foreach my $area (keys(%{$$cmsmap{$cms}})) {
                         if ($resources{$res}{type} eq $$cmsmap{$cms}{$area}) {
                             $count{$area} ++;
                         }
                     }
                 } elsif ($cms eq 'angel5') {
-                    foreach my $area (keys %{$$cmsmap{$cms}}) {
+                    foreach my $area (keys(%{$$cmsmap{$cms}})) {
                         if ($area eq 'doc') {
                             if (grep/^$resources{$res}{type}$/,@{$$cmsmap{$cms}{doc}}) {
                                 $count{$area} ++;
@@ -564,7 +564,7 @@
 
     if ($manifest_result eq 'ok') {
         my %possibledep;
-        foreach my $res (sort keys %resources) {
+        foreach my $res (sort(keys(%resources))) {
             if ($importareas{$resources{$res}{type}}) {
                 $includedres{$res} = 1;
                 if ($resources{$res}{type} eq 'webct.manifest' || 
@@ -581,12 +581,12 @@
                 $includedres{$res} = 1;
             }
         }
-        foreach my $itm (sort keys %items) {
+        foreach my $itm (sort(keys(%items))) {
             &Apache::imsprocessor::get_imports(\%includeditems,\%items,\%resources,\%importareas,$itm);
         }
     }
 
-    foreach my $itm (sort keys %includeditems) {
+    foreach my $itm (sort(keys(%includeditems))) {
         &Apache::imsprocessor::get_parents(\%includeditems,\%items,$itm);
     }
 
@@ -686,7 +686,7 @@
             push @{$courses{$currcode}}, $cdom.'/'.$crs;
         }
     }
-    foreach my $code (sort @codes) {
+    foreach my $code (sort(@codes)) {
         foreach my $crsdom (@{$courses{$code}}) {
             my ($cdom,$crs) = split/\//,$crsdom;
             my $showcode = '';




More information about the LON-CAPA-cvs mailing list