Nigel Peck wrote: > > I'm missing something here with regards http redirects. > > I'm trying to have my script redirect to itself through the browser so that > the URL changes in the browser. > > When I send the headers myself: > > print 'Location: ' . $_[0] . "\n"; > print 'Connection: close' . "\n\n"; > > The redirect works but the web address does not change in the browser. When I > use: > > use CGI.pm; > > my $q = new CGI; > > print $q->redirect( > -location => $_[0], > -status => 301, > ); > > The redirect works and changes the browser URL. > > What is CGI.pm doing differently to me? > > I want to do this without using CGI.pm (so I understand what's going on).
The only way to fully understand what CGI does is to read its code. Perl modules are unusually transparent so that you can do that - there are few black boxes. Having read the code, if you don't understand it then you really don't want to know yet. The clear conclusion from what you have posted is that your own code doesn't return a 301 Moved Permanently status. I really don't want to lend you the spanner to open your refrigerator: you will probably break it. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/