--- loncom/automation/Autocreate.pl	2007/09/03 15:34:16	1.7
+++ loncom/automation/Autocreate.pl	2008/03/18 20:51:12	1.10
@@ -2,6 +2,8 @@
 #
 # Automated Course Creation script
 #
+# $Id: Autocreate.pl,v 1.10 2008/03/18 20:51:12 raeburn Exp $
+#
 # Copyright Michigan State University Board of Trustees
 #
 # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
@@ -101,16 +103,18 @@
 
     print $fh "Sending to batch - auto,$defdom,$dcname,$dcdom ".join(":",@requests)."\n";
     my ($result,$logmsg) = &LONCAPA::batchcreatecourse::create_courses(\@requests,\%courseids,'auto',$defdom,$dcname,$dcdom);
-    my $output;
+    my $outcome;
     if ($result ne '') {
-        $output = $result."\n";
+        $outcome = $result."\n";
     }
     if ($logmsg ne '') {
-        $output .= $logmsg."\n";    
+        $outcome .= $logmsg."\n";    
     }
+    print $fh $outcome;
 
+    my $output;
 # Copy requests from pending directory to processed directory and unlink.
-  foreach my $request (@requests) {  
+    foreach my $request (@requests) {  
         if ((-e "$batchdir/pending/$request") && $request !~ /\.\./ && $request ne '' &&$request ne './') {
             open(FILE,"<$batchdir/pending/$request");
             my @buffer = <FILE>;