#!/usr/bin/perl use CGI; $query = new CGI; if($ENV{'HTTP_COOKIE'}){ print $query->header; print"
\n";
$cook = $ENV{'HTTP_COOKIE'};
@cookies = split /;/, $cook;
foreach $new (@cookies){
print "Welcome back:" . $new;
}
print "\n";
}
else{
if($query->param('name')){
$cookie = $query->cookie(-name=>'user',
-value=>$query->param('name'),
-expires=>'+30d',
-path=>'/');
print $query->header(-cookie=>$cookie);
print "Thank you for registering!\n";
print "When you view this page again you will se a welcoming message i
+nstead of the form