in reply to CGI redirect

You should be able to, are you trying something like this?:
my $cookie = $query->cookie(-name=>'foo',-value=>'bar',-domain=>'mydom +ain.com'); print $query->header(-type=>'text/html',-cookie=>$cookie);
To generate cookies, you have to use the CGI::cookie method.