[LON-CAPA-cvs] cvs: loncom /xml run.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 03 May 2002 22:30:54 -0000


albertel		Fri May  3 18:30:54 2002 EDT

  Modified files:              
    /loncom/xml	run.pm 
  Log:
  - better protection of output
  
  
Index: loncom/xml/run.pm
diff -u loncom/xml/run.pm:1.26 loncom/xml/run.pm:1.27
--- loncom/xml/run.pm:1.26	Wed Apr 10 11:22:02 2002
+++ loncom/xml/run.pm	Fri May  3 18:30:54 2002
@@ -1,6 +1,6 @@
 package Apache::run;
 #
-# $Id: run.pm,v 1.26 2002/04/10 15:22:02 albertel Exp $
+# $Id: run.pm,v 1.27 2002/05/03 22:30:54 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -82,19 +82,21 @@
   my $dump='';
   foreach my $symname (sort keys %{$safeeval->varglob('main::')}) {
     if (($symname!~/^\_/) && ($symname!~/\:$/)) {
+      my $line;
       if ($safeeval->reval('defined($'.$symname.')')) {
-	$dump.='$'.$symname.'='.$safeeval->reval('$'.$symname)."\n";
+	$line='$'.$symname.'='.$safeeval->reval('$'.$symname);
       }	
       if ($safeeval->reval('defined(@'.$symname.')')) {
-	$dump.='@'.$symname.'=('.
-	  $safeeval->reval('join(",",@'.$symname.')').")\n";
+	$line='@'.$symname.'=('.
+	  $safeeval->reval('join(",",@'.$symname.')').")";
       }
       if ($safeeval->reval('defined(%'.$symname.')')) {
-	$dump.='%'.$symname.'=(';
-	$dump.=$safeeval->reval('join(",",map { $_."=>".$'.
+	$line='%'.$symname.'=(';
+	$line.=$safeeval->reval('join(",",map { $_."=>".$'.
 				$symname.'{$_} } sort keys %'.
-				$symname.')').")\n";
+				$symname.')').")"
       }
+      if ($line ne '') { $dump.=&HTML::Entities::encode($line)."<br />\n"; }
     }
   }
   $dump.='';