Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

hi i know this is probably a stupid question but i have a perl cgi script that i want to redirect the user to an html page, how do i do that?

Edit kudra, 2002-05-20 Changed title

Replies are listed 'Best First'.
Re: redirect
by dsheroh (Monsignor) on May 18, 2002 at 16:34 UTC
    Assuming you're using CGI.pm, use the redirect method:
    print redirect("http://www.elsewhere.com/some/document.html");
    (And if you're not using CGI.pm, you should be.)
Re: redirect
by Dog and Pony (Priest) on May 18, 2002 at 16:34 UTC
    Generating a redirection header from the standard CGI docs. You are using CGI.pm, right? :)
    You have moved into a dark place.
    It is pitch black. You are likely to be eaten by a grue.
Re: redirect
by BazB (Priest) on May 18, 2002 at 16:35 UTC
    perldoc CGI
    #Straight from the perldoc use CGI; my $query = new CGI; print $query->redirect('http://somewhere.else/in/movie/land');
Re: redirect
by Anonymous Monk on May 18, 2002 at 17:21 UTC
    ok nope i wasn't but i am now thats a lot easier thanks
      Glad that you're now using CGI - it will make your life a lot easier! You might also be interested in reading the following two nodes for further information about why you should be using CGI and how it can help you.


      - wil