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

I'm working on a send mail script and I would like to redirect it to a success page when the email is sent? how can I do this? I tryed to using a small script like this to test it but my server just gave me a internal configuration error message?
#!/usr/bin/perl use CGI; $q = new CGI; print $q->redirect("");

Replies are listed 'Best First'.
Re: Redirection in parl?
by Fastolfe (Vicar) on Feb 07, 2001 at 23:46 UTC
    The code you gave is fine, so I suspect it is either a permissions or configuration problem.

    Generally when debugging CGI problems it helps to examine the web server's error logs so that you can see what the error message is. Attempting to debug problems like this without having access to error messages will be very difficult (arguably impossible for a novice).

    In a pinch, in the absense of log file access, this could help you considerably:

    use CGI::Carp 'fatalsToBrowser';
Re: Redirection in perl?
by dws (Chancellor) on Feb 07, 2001 at 23:44 UTC
    print "Location:\r\n\r\n";
Re: Redirection in parl?
by gryphon (Abbot) on Feb 08, 2001 at 01:06 UTC

    Greetings SilverB1rd,

    You could always try using HTML rather than Perl. I don't know if this will help your situation, but you never know. Try this:

    my $url = ''; print "<Meta HTTP-EQUIV=\"Refresh\" CONTENT=\"0;URL=$url\">\n\n";


      Thanks guys! the print "Location:\r\n\r\n"; works fine for me.