Print header with CGI

The header prints out Content-type: text/html\n\n . You can do the same thing with sessions above, which also sets a cookie.

#!/usr/bin/perl

use strict;
use CGI;

$cgi = CGI->new();

print $cgi->header();

print $cgi->header(); actually sets a cookie, prints the date, and the Content-type: text/html\n\n portion of the headers.

You can set that cookie manually with,

$cookie = new CGI::Cookie(-name=>'CGISESSID', -value=>$session->id);
print $cgi->header(-cookie=>$cookie);

Page Comments (Click to edit)






[Click to add or edit comments])

Please prepend comments below including a date

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Have a nice day.