Abort Script



There are a couple of alternate ways to do what's below. One of the better ways is to catch the 'die' at the top level, then re-throw it. That way the program exits in the right place and the HTML is terminated correctly (it's not at present), but the error is still written to the log. There is now a standard library, CGI::Carp, which provides the ability to exit meaningfully from CGIs. -- PhilipCohen

  sub AbortScript {
    local ($msg) = @_;
    print <<EOF ;
      <h3>The Wiki Wiki Server Can't Process Your Request</h3>
      $msg<p>
      This information has been logged.<br>
      We are sorry for any inconvenience.
    EOF
    die $msg;
  }

tesing

 

Last edited October 1, 2003
Return to WelcomeVisitors