如何编写 Perl 模块程序来检查安全 cookie 或 Httponly 标志的 cookie 属性,并使用测试模块显示结果是否包含安全和 Httponly 标志。以下是 Cookie 的代码。请有人给出代码。
use strict;
use LWP::simple;
use LWP::UserAgent;
use HTTP::Request;
my $URL = 'https://www.gmail.com/';
my $ua = LWP::UserAgent->new();
my $header = HTTP::Request->new(GET => $URL);
my $request = HTTP::Request->new('GET', $URL, $header);
my $response = $ua->request($request);
print $_ foreach @ {$response->headers()->{'set-cookie'}};