[LON-CAPA-cvs] cvs: modules /gerd/maxima lonmaxima

albertel lon-capa-cvs@mail.lon-capa.org
Sat, 04 Mar 2006 06:44:14 -0000


albertel		Sat Mar  4 01:44:14 2006 EDT

  Modified files:              
    /modules/gerd/maxima	lonmaxima 
  Log:
  - eliminating unneeded globals
  
  
Index: modules/gerd/maxima/lonmaxima
diff -u modules/gerd/maxima/lonmaxima:1.7 modules/gerd/maxima/lonmaxima:1.8
--- modules/gerd/maxima/lonmaxima:1.7	Fri Mar  3 21:33:54 2006
+++ modules/gerd/maxima/lonmaxima	Sat Mar  4 01:44:11 2006
@@ -3,7 +3,7 @@
 # The LearningOnline Network with CAPA
 # Connect to MAXIMA CAS
 #
-# $Id: lonmaxima,v 1.7 2006/03/04 02:33:54 www Exp $
+# $Id: lonmaxima,v 1.8 2006/03/04 06:44:11 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -52,10 +52,8 @@
 my $port;                              # path to UNIX socket file
 my %perlvar;                           # configuration file info
 my $lastlog;                           # last string that was logged
-my $maximapid;                         # PID of maxima process
-my $selector;                          # open3's selector
 use vars qw($PREFORK $MAX_CLIENTS_PER_CHILD %children $children $status
-	    $pidfile $port %perlvar $lastlog $maximapid $selector);
+	    $pidfile $port %perlvar $lastlog);
  
 sub maximareply {
     my ($cmd) = @_;
@@ -66,7 +64,7 @@
     unless ($cmd=~/\;\n$/) { $cmd.=";\n"; }
 
     my ($cmd_in, $cmd_out, $cmd_err);
-    $maximapid = open3($cmd_in, $cmd_out, $cmd_err, 'maxima');
+    my $maximapid = open3($cmd_in, $cmd_out, $cmd_err, 'maxima');
     $children{$maximapid} = 1;
     
     print $cmd_in $cmd;
@@ -78,7 +76,7 @@
     alarm(5);
     no strict 'refs';
 
-    $selector = IO::Select->new();
+    my $selector = IO::Select->new();
 
     $selector->add($cmd_err, $cmd_out);