[system] / trunk / webwork2 / lib / WeBWorK / CourseEnvironment.pm Repository:
ViewVC logotype

Diff of /trunk/webwork2/lib/WeBWorK/CourseEnvironment.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 394 Revision 395
39 39
40 # read and evaluate the course environment file 40 # read and evaluate the course environment file
41 # if readFile failed, we don't bother trying to reval 41 # if readFile failed, we don't bother trying to reval
42 my $courseFileContents = eval { readFile($courseEnvironmentFile) }; # catch exceptions 42 my $courseFileContents = eval { readFile($courseEnvironmentFile) }; # catch exceptions
43 $@ or $safe->reval($courseFileContents); 43 $@ or $safe->reval($courseFileContents);
44 $@ = "";
45 44
46 # get the safe compartment's namespace as a hash 45 # get the safe compartment's namespace as a hash
47 no strict 'refs'; 46 no strict 'refs';
48 my %symbolHash = %{$safe->root."::"}; 47 my %symbolHash = %{$safe->root."::"};
49 use strict 'refs'; 48 use strict 'refs';
113# ----- utils ----- 112# ----- utils -----
114 113
115sub readFile { 114sub readFile {
116 my $fileName = shift; 115 my $fileName = shift;
117 open INPUTFILE, "<", $fileName 116 open INPUTFILE, "<", $fileName
118 or die "Couldn't open environment file $fileName: $!"; 117 ;#or die "Couldn't open environment file $fileName: $!";
119 my $result = join "\n", <INPUTFILE>; 118 my $result = join "\n", <INPUTFILE>;
120 close INPUTFILE; 119 close INPUTFILE;
121 return $result; 120 return $result;
122} 121}
123 122

Legend:
Removed from v.394  
changed lines
  Added in v.395

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9