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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 21 Mar 2003 22:41:13 -0000


albertel		Fri Mar 21 17:41:13 2003 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  - global vars fixup
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.164 loncom/interface/lonnavmaps.pm:1.165
--- loncom/interface/lonnavmaps.pm:1.164	Thu Mar 20 15:40:18 2003
+++ loncom/interface/lonnavmaps.pm	Fri Mar 21 17:41:12 2003
@@ -2,7 +2,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.164 2003/03/20 20:40:18 bowersj2 Exp $
+# $Id: lonnavmaps.pm,v 1.165 2003/03/21 22:41:12 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -42,6 +42,7 @@
 # Jeremy Bowers ... lots of days
 
 package Apache::lonnavmaps;
+use vars qw($test @refsToUntie);
 
 use strict;
 use Apache::Constants qw(:common :http);
@@ -51,7 +52,7 @@
 
 my %navmaphash;
 my %parmhash;
-my @refsToUntie;
+@refsToUntie;
 
 # symbolic constants
 sub SYMB { return 1; }
@@ -99,11 +100,11 @@
 # And a special case in the nav map; what to do when the assignment
 # is not yet done and due in less then 24 hours
 my $hurryUpColor = "#FF0000";
-my $test = 'abc';
+$test = 'abc';
 sub cleanup {
     &Apache::lonnet::logthis("Cleanup called.");
-    &Apache::lonnet::logthis(scalar(@refsToUntie));
-    &Apache::lonnet::logthis($test);
+    &Apache::lonnet::logthis("refs size".scalar(@refsToUntie));
+    &Apache::lonnet::logthis("test is ".$test);
     $test = '467';
     if (tied(%navmaphash)){
 	&Apache::lonnet::logthis('Cleanup navmaps: navmaphash');
@@ -1321,11 +1322,12 @@
 
     $self->{NAV_HASH} = \%Apache::lonnavmaps::navmaphash;
     $self->{PARM_HASH} = \%Apache::lonnavmaps::parmhash;
-    push @Apache::lonnavmaps::refsToCleanup, $self->{NAV_HASH};
-    push @Apache::lonnavmaps::refsToCleanup, $self->{PARM_HASH};
-    Apache::lonnet::logthis(scalar(@Apache::lonnavmaps::refsToCleanup));
+    push @Apache::lonnavmaps::refsToUntie, $self->{NAV_HASH};
+    push @Apache::lonnavmaps::refsToUntie, $self->{PARM_HASH};
+    &Apache::lonnet::logthis("refstountie ".scalar(@Apache::lonnavmaps::refsToUntie));
+    &Apache::lonnet::logthis("navmaps test".$Apache::lonnavmaps::test);
     $Apache::lonnavmaps::test = '123';
-    Apache::lonnet::logthis($Apache::lonnavmaps::test);
+    &Apache::lonnet::logthis("navmaps test".$Apache::lonnavmaps::test);
     $self->{INITED} = 0;
 
     $self->{RESPONSE}->register_cleanup(\&Apache::lonnavmaps::cleanup);