#!/usr/bin/perl -w
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
## Make a CGI object
my $q = new CGI;
### gets the value of the cookie named username into
### the var $cookie_username_get
my $cookie_username_get = $q->cookie('username');
### sets the cookie $cookie_username_set
### to the value of $the_username
my $cookie_username_set = $q->cookie (
-name => 'username',
-value => "$the_username",
-path => '/',
-expires => '+1y'
);