--- loncom/xml/run.pm 2005/02/26 06:10:30 1.50
+++ loncom/xml/run.pm 2005/10/04 16:30:23 1.52
@@ -1,6 +1,6 @@
package Apache::run;
#
-# $Id: run.pm,v 1.50 2005/02/26 06:10:30 albertel Exp $
+# $Id: run.pm,v 1.52 2005/10/04 16:30:23 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -83,13 +83,13 @@ sub evaluate {
};
my $innererror;
eval {
- alarm($Apache::lonnet::perlvar{'lonScriptTimeout'});
+ &Apache::lonxml::start_alarm();
$safeeval->reval('{'.$decls.';$_=<<\'EXPRESSION\';'."\n".$expression.
"\n".'EXPRESSION'."\n".$EVALUATE_STRING.'}');
$innererror=$@;
- alarm(0);
+ &Apache::lonxml::end_alarm();
};
- my $error=$@;
+ my $error=$@;
if ($error eq '' && $innererror eq '' && !$Apache::run::timeout) {
$result = $safeeval->reval('return $_;');
chomp $result;
@@ -121,10 +121,10 @@ sub run {
};
my $innererror;
eval {
- alarm($Apache::lonnet::perlvar{'lonScriptTimeout'});
+ &Apache::lonxml::start_alarm();
@result=$safeeval->reval($code);
$innererror=$@;
- alarm(0);
+ &Apache::lonxml::end_alarm();
};
my $error=$@;
if (($Apache::run::timeout || $error ne '' || $innererror ne '') && !$hideerrors) {
@@ -176,7 +176,7 @@ sub dump {
}
if ($line ne '') {
$line=&HTML::Entities::encode($line,'<>&"');
- $line=~s|\n|
|;
+ $line=~s|\n|
|g;
$dump.=$line;
}
}