use strict; #use warnings; use CGI qw(param :standard); require Exporter; our @ISA = qw(Exporter); our %EXPORT_TAGS = ( 'all' => [ qw($MyCookie $PrintHeader CheckCookie) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw($MyCookie $PrintHeader CheckCookie); our $VERSION = '1.0'; our $PrintHeader = "Content-type: text/html\n\n"; our $MyCookie = "ARandomCookie"; sub CheckCookie { my $affil = cookie($MyCookie); if ($affil eq ''){ $affil = "It Should Be Set!!"; my $packedURLcookie = cookie( -NAME => $MyCookie, -VALUE => "$affil", -path => "/"); print "Set-Cookie: $packedURLcookie\n"; return 1; } } 1; #### #!/usr/bin/perl use strict; use CGI qw(param :standard); use CookTest; my $subres = &CheckCookie; my $alleged = cookie($MyCookie); print $PrintHeader; print < Cookie tester My sub cal results are $subres

My alleged cookie is $alleged

EOF exit;