MAIN: { my $cgi = new CGI; my $uiutils = new UiUtils::; #User defined package my $path_info = $cgi->path_info(); $path_info =~ s/^\///; my $page; my $mypage; print qq|Content-type: text/html\n\n|; $page = $uiutils->getSkin(); chdir($LEGACY_CGI_DIR); my $code = qx(cat $LEGACY_CGI_DIR/$path_info); $0 = $path_info; use FileHandle; my $filehandle = new FileHandle; my $TMP_DIR = $::CONFIG->getTmpDirForUiController(); open ($filehandle, ">$TMP_DIR/$$"); select($filehandle); my $eval_error; { open(SAVEERR, ">&STDERR"); open(STDERR, ">/dev/null"); eval $code; $eval_error = $@; open(STDERR, ">&SAVEERR"); close(SAVEERR); } select(STDOUT); close($filehandle); my $error; if ($eval_error) { $error = "EVAL ERROR: " . $eval_error . "\n"; print STDERR "EVAL ERROR: $eval_error\n"; } open ($filehandle, "<$TMP_DIR/$$"); {undef $/; $mypage = <$filehandle>;} ########This is the line where the error is occuring close($filehandle); unlink("$TMP_DIR/$$"); $mypage =~ /(.*?)<\/title>/si; my $title = $1 || "Mprov"; print "<script>document.title='$title'</script>\n"; $mypage =~ s/.*<!--CONTENT-->//iso; $mypage =~ s/<!--ENDCONTENT-->.*//iso; $mypage =~ s/<img.*?\/images\/banner\.gif.*?>//iso; $mypage ||= $error; my $contents = new WebUi::Mech::RawHtml( -text => $mypage, ); $page->pack($contents); $page->showAll(); }