--- loncom/xml/scripttag.pm 2000/08/16 18:32:58 1.13
+++ loncom/xml/scripttag.pm 2000/09/19 19:10:01 1.16
@@ -15,6 +15,7 @@ sub BEGIN {
sub start_script {
my ($target,$token,$parstack,$parser,$safeeval)=@_;
my $result="";
+ $safeeval->share('$Apache::scripttag::start_script::result');
# my $bodytext=$$parser[$#$parser]->get_text("/script");
my $bodytext=&Apache::lonxml::get_all_text("script",$$parser[$#$parser]);
@@ -23,7 +24,7 @@ sub start_script {
}
# print "
script runs $bodytext";
- $result = &Apache::run::run($bodytext,$safeeval);
+ &Apache::run::run($bodytext,$safeeval);
if ($target eq "edit" ) {
$result= "
<$token->[1]> output:
$bodytext
Source:
";
@@ -76,6 +77,10 @@ sub start_import {
$bodytext=Apache::run::evaluate($bodytext,$safeeval,$$parstack[$#$parstack]);
my $file=&getfile($bodytext);
+ if ($file eq -1) {
+ return " Unable to find $bodytext for import";
+ }
+
my $tempparser=HTML::TokeParser->new(\$file);
push (@$parser,$tempparser);
@@ -110,6 +115,7 @@ sub getfile {
&Apache::lonnet::subscribe($filename);
&Apache::lonnet::repcopy($filename);
}
+ if (! -e $filename ) { return -1; };
my $fh=Apache::File->new($filename);
while (<$fh>) {
$a .=$_;