Listing 6: show-cookies.pl, a program that displays all cookies saved
on your machine. Cookies are only sent to the server that created or
set their value, 

#!/usr/bin/perl -w

use strict;
use diagnostics;
use CGI;     # see http://www.perl.com/CPAN

# Create an instance of CGI
my $query = new CGI;
print $query->header("text/html");
print $query->start_html(-title => "Cookies received");

# Create a new cookie with a name "counter" and the value "1".
my @cookies = $query->cookie;

my $cookie = "";
foreach $cookie (@cookies)
{
  print "<P>$cookie = ", $query->cookie($cookie), "</P>\n";
}

# Send some HTML as a placeholder
print $query->end_html;


