in reply to Perl Redirect - Complete Perl Newbie

When you say you "Can't get it to work" what exactly is happening? Are you getting an error, or are the redirects just not working. If you are in control of the server you should be able to get more detail from the error log of the web server.

However it is almost certain that the actual problem is that you should have:

use CGI ':standard';
Rather than:
use CGI 'standard';

/J\

Replies are listed 'Best First'.
Re^2: Perl Redirect - Complete Perl Newbie
by Tomster (Initiate) on Feb 11, 2005 at 10:10 UTC
    Thanks for the advice and sorry for the lack of information. I'm getting a HTTP 500 error...?

    Adding the colon didn't seem to make any difference.

    This is the full page code:
    #!/usr/bin/perl use CGI ':standard'; $shop = param('shop'); if ($shop eq 'rg') { print redirect('https://www.planetdistribution.co.uk/store/index.php?c +Path=6'); }elsif ($shop eq 'ps') { print redirect('https://www.planetdistribution.co.uk/store/index.php?c +Path=1'); }elsif ($shop eq 'sk') { print redirect('https://www.planetdistribution.co.uk/store/index.php?c +Path=19'); }elsif ($shop eq 'smm') { print redirect('https://www.planetdistribution.co.uk/store/index.php?c +Path=9'); }else{ print redirect('https://www.planetdistribution.co.uk/store'); }