#!/usr/bin/perl use warnings; use strict; use CGI; my $query = new CGI; my $cookie = $query->cookie(CGISESSID => 'werd'); print $query->header( -cookie=>$cookie, -location=>'http://www.google.com/' ); #<-- this is the important line! exit;