Well, sure, but technically, if that is being sent directly to the browser (say, from a lightweight server using a direct socket), you need to send "\cM\cJ" not just "\n", according to the RFCs.print "Status: 302 Found\n", "Location: http://www.perlmonks.com/\n\n";
This is why it's better to use CGI.pm... all that stuff just works:
localhost:~ % perl -MCGI=redirect -e 'print redirect("/somewhere")' | +od -c 0000000 S t a t u s : 3 0 2 M o v + e 0000020 d \r \n L o c a t i o n : / s + o 0000040 m e w h e r e \r \n \r \n + 0000053
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to Re^2: How redirect the page in CGI programming?
by merlyn
in thread How redirect the page in CGI programming?
by muthuvel_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |