my $myDocument = get "http://www.ecst.csuchico.edu/"; my $result; if ($myDocument) { # we got a response $result = $myDocument; } else { # Something went wrong $result = "There was a problem somewhere and I didn't get an answer."; }; print "Content-type: text/html\n\n"; print $result;