[LON-CAPA-cvs] cvs: loncom /interface printout.pl

foxr lon-capa-cvs@mail.lon-capa.org
Thu, 04 Aug 2005 21:26:25 -0000


foxr		Thu Aug  4 17:26:25 2005 EDT

  Modified files:              
    /loncom/interface	printout.pl 
  Log:
  Make some name splitting a bit more efficient and clearer.
  
  
Index: loncom/interface/printout.pl
diff -u loncom/interface/printout.pl:1.88 loncom/interface/printout.pl:1.89
--- loncom/interface/printout.pl:1.88	Wed Aug  3 06:34:03 2005
+++ loncom/interface/printout.pl	Thu Aug  4 17:26:23 2005
@@ -285,8 +285,7 @@
   my $name_range='';
   if ($tempo_array[3]) {
       $name=$tempo_array[3];
-      my @full_names = split(/,/,$name); # split last name from others...
-      $name_range = $full_names[0];
+      ($name_range) = split(/,/,$name, 2);
   } else {
       $name=$tempo_array[0].'@'.$tempo_array[1];
       $name_range = $tempo_array[0];
@@ -299,8 +298,8 @@
       @tempo_array=split(/:/,$stud_info[-1]);
       if ($tempo_array[3]) {
 	  $name=$tempo_array[3];
-	  my @full_names = split(/,/, $name);
-	  $name_range .= "-".$full_names[0];
+	  my ($lastname) = split(/,/, $name,2);
+	  $name_range .= "-".$lastname;
       } else {
 	  $name=$tempo_array[0].'@'.$tempo_array[1];
 	  $name_range .= '-'.$tempo_array[0];