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

raeburn raeburn at source.lon-capa.org
Wed Dec 10 19:07:13 EST 2014


raeburn		Thu Dec 11 00:07:13 2014 EDT

  Modified files:              
    /loncom/interface	courseclassifier.pm 
  Log:
  - Coding style:
    keys() sort()
  
  
Index: loncom/interface/courseclassifier.pm
diff -u loncom/interface/courseclassifier.pm:1.19 loncom/interface/courseclassifier.pm:1.20
--- loncom/interface/courseclassifier.pm:1.19	Thu Jul 31 15:45:27 2014
+++ loncom/interface/courseclassifier.pm	Thu Dec 11 00:07:12 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Utilities for classifying courses based on institutional code
 #
-# $Id: courseclassifier.pm,v 1.19 2014/07/31 15:45:27 musolffc Exp $
+# $Id: courseclassifier.pm,v 1.20 2014/12/11 00:07:12 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -148,7 +148,7 @@
     for (my $i=1; $i<@{$codetitles}; $i++) {
         %{$idarrays{$$codetitles[$i]}} = ();
     }
-    foreach my $cid (sort keys %{$codes}) {
+    foreach my $cid (sort(keys(%{$codes}))) {
         &recurse_list($cid,$codetitles,$codes,0,\%idarrays);
     }
     for (my $num=0; $num<@{$codetitles}; $num++) {
@@ -169,7 +169,7 @@
         } elsif ($num == 1) {
             %{$$idlist{$$codetitles[1]}} = ();
             %{$$idlist_titles{$$codetitles[1]}} = ();
-            foreach my $key_a (keys %{$idarrays{$$codetitles[1]}}) {
+            foreach my $key_a (keys(%{$idarrays{$$codetitles[1]}})) {
                 my @sorted_a = ();
                 my @sorted_a_titles = ();
                 &sort_cats($num,$cat_order,$codetitles,\@{$idarrays{$$codetitles[1]}{$key_a}},\@sorted_a);
@@ -187,10 +187,10 @@
         } elsif ($num == 2) {
             %{$$idlist{$$codetitles[2]}} = ();
             %{$$idlist_titles{$$codetitles[2]}} = ();
-            foreach my $key_a (keys %{$idarrays{$$codetitles[2]}}) {
+            foreach my $key_a (keys(%{$idarrays{$$codetitles[2]}})) {
                 %{$$idlist{$$codetitles[2]}{$key_a}} = ();
                 %{$$idlist_titles{$$codetitles[2]}{$key_a}} = ();
-                foreach my $key_b (keys %{$idarrays{$$codetitles[2]}{$key_a}}) {
+                foreach my $key_b (keys(%{$idarrays{$$codetitles[2]}{$key_a}})) {
                     my @sorted_b = ();
                     my @sorted_b_titles = ();
                     &sort_cats($num,$cat_order,$codetitles,\@{$idarrays{$$codetitles[2]}{$key_a}{$key_b}},\@sorted_b);
@@ -208,11 +208,11 @@
             }
         } elsif ($num == 3) {
             %{$$idlist{$$codetitles[3]}} = ();
-            foreach my $key_a (keys %{$idarrays{$$codetitles[3]}}) {
+            foreach my $key_a (keys(%{$idarrays{$$codetitles[3]}})) {
                 %{$$idlist{$$codetitles[3]}{$key_a}} = ();
-                foreach my $key_b (keys %{$idarrays{$$codetitles[3]}{$key_a}}) {
+                foreach my $key_b (keys(%{$idarrays{$$codetitles[3]}{$key_a}})) {
                     %{$$idlist{$$codetitles[3]}{$key_a}{$key_b}} = ();
-                    foreach my $key_c (keys %{$idarrays{$$codetitles[3]}{$key_a}{$key_b}}) {
+                    foreach my $key_c (keys(%{$idarrays{$$codetitles[3]}{$key_a}{$key_b}})) {
                         my @sorted_c = ();
                         my @sorted_c_titles = ();
                         &sort_cats($num,$cat_order,$codetitles,\@{$idarrays{$$codetitles[3]}{$key_a}{$key_b}{$key_c}},\@sorted_c);
@@ -231,13 +231,13 @@
             }
         } elsif ($num == 4) {
             %{$$idlist{$$codetitles[4]}} = ();
-            foreach my $key_a (keys %{$idarrays{$$codetitles[4]}}) {
+            foreach my $key_a (keys(%{$idarrays{$$codetitles[4]}})) {
                 %{$$idlist{$$codetitles[4]}{$key_a}} = ();
-                foreach my $key_b (keys %{$idarrays{$$codetitles[4]}{$key_a}}) {
+                foreach my $key_b (keys(%{$idarrays{$$codetitles[4]}{$key_a}})) {
                     %{$$idlist{$$codetitles[4]}{$key_a}{$key_b}} = ();
-                    foreach my $key_c (keys %{$idarrays{$$codetitles[4]}{$key_a}{$key_b}}) {
+                    foreach my $key_c (keys(%{$idarrays{$$codetitles[4]}{$key_a}{$key_b}})) {
                         %{$$idlist{$$codetitles[4]}{$key_a}{$key_b}{$key_c}} = ();
-                        foreach my $key_d (keys %{$idarrays{$$codetitles[4]}{$key_a}{$key_b}{$key_c}}) {
+                        foreach my $key_d (keys(%{$idarrays{$$codetitles[4]}{$key_a}{$key_b}{$key_c}})) {
                             my @sorted_d = ();
                             my @sorted_d_titles = ();
                             &sort_cats($num,$cat_order,$codetitles,$idarrays{$$codetitles[4]}{$key_a}{$key_b}{$key_c}{$key_d},\@sorted_d);




More information about the LON-CAPA-cvs mailing list