#!/usr/bin/perl -w use strict; use warnings; use CGI qw(:header); use CGI::Cookie; # Create a new cookie my $c = new CGI::Cookie; $c->name("MY_COOKIE"); $c->value("blah"); # Print a html header with the cookie info print header( -cookie=>[$c] ); # Find the value of the cookie we just created my %cookies = fetch CGI::Cookie; if ($cookies{'MY_COOKIE'}) { print $cookies{'MY_COOKIE'}->value; } # end-if exit;