in reply to Help needed on HTTP redirects

You don't need to use LWP or HTTP modules to send a browser redirect; that's handled by the ever-present CGI module.

#!/usr/bin/perl -T use strict; use warnings; use CGI; my $q = CGI->new; # send a redirect print $q->header(-location => 'http://www.foo.com/bar.html');

If you need to check the status of the other pages, you may want to use LWP::Simple to fetch them and examine the contents.

Replies are listed 'Best First'.
Re^2: Help needed on HTTP redirects
by Spenser (Friar) on Aug 04, 2004 at 17:40 UTC
    How about this deviation on the same theme:
    use CGI ':standard'; print CGI->redirect(-location=>"http://www.food.com/bar.html");
    Better yet, why not do some configuring in Apache. You could redirect the user to a diffent web page depending on the error message. Here are examples for error 404 and error 500, which are typical ones, that you could add to /etc/httpd/conf/httpd.conf configuration file or even to a .htaccess file.
    ErrorDocument 404 /error_msgs/error_notfound.html ErrorDocument 500 /error_msgs/error_scriptproblem.html
    See this article on Apache Redirection from Unix Review.

    -Spenser

    That's Spenser, with an "s" like the detective.