in reply to print and redirect

I try not to mess with headers directly; let CGI.pm do the work:
use CGI; my $url = 'www.somewhere.com'; print CGI::redirect($url);

Replies are listed 'Best First'.
Re: Re: print and redirect
by cei (Monk) on Apr 10, 2001 at 22:37 UTC
    And to include the cookie functionality that costas later mentioned he wanted, you could do:

    use CGI; my $page = new CGI; my $url = 'www.somewhere.com'; my $cookie = $page->cookie(-name=>'sessionID', -value=>'xyzzy', -expires=>'+1h', -path=>'/cgi-bin/database', -domain=>'.foo.bar', -secure=>1); print $page->redirect(-location=>'http://somewhere.else/', -cookie=>$cookie);