--- loncom/xml/run.pm 2002/04/10 15:22:02 1.26 +++ loncom/xml/run.pm 2002/05/23 21:12:44 1.28 @@ -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.28 2002/05/23 21:12:44 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -62,7 +62,9 @@ sub run { my ($code,$safeeval,$hideerrors) = @_; # print "inside run\n"; $@=''; + $Apache::lonxml::request->hard_timeout("Apache::run::run, evaluation $code"); my (@result)=$safeeval->reval($code); + $Apache::lonxml::request->kill_timeout; my $error=$@; if ($error ne '' && !$hideerrors) { &Apache::lonxml::error('
'.&HTML::Entities::encode($error). @@ -82,19 +84,21 @@ sub dump { 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)."
\n"; } } } $dump.='';