#!/usr/local/bin/perl
use CGI qw/:standard/;
use CGI::Cookie;
%Cookies = fetch CGI::Cookie;
&compilevalue;
print "Content-type: text/html\n\n";
print "<body><pre>";
print "E-Mail : $v{'email'}\n";
print "Sex : $v{'sex'}\n";
print "Prefer : $v{'prefer'}<hr>";
print %Cookies;
sub compilevalue {
foreach $r (keys %Cookies) {
@rec = split(";",$Cookies{$r});
($name,$value) = split("=",$rec[0]);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$v{$name} = $value;
}
}
จำนวน : 20 บรรทัด