--- loncom/xml/run.pm	2005/02/26 06:10:30	1.50
+++ loncom/xml/run.pm	2005/02/28 22:17:09	1.51
@@ -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.51 2005/02/28 22:17:09 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) {