我想将以下HTML元标记包含在cgi脚本中:
<meta name="googlebot" content="noindex,nofollow,noarchive,noodp,nosnippet" />
但是为什么这不会打印出结果?
use CGI;
print
$query->start_html(-title =>'MyWeb',
-meta => {
-name =>'googlebot',
-content =>'noindex,nofollow,noarchive,noodp,nosnippet'}
),p;
这样做的正确方法是什么?
答案 0 :(得分:3)
use strict;
use warnings;
use CGI;
my $query = CGI->new();
print
$query->start_html(-title =>'MyWeb',
-meta => {'googlebot' => 'noindex,nofollow,noarchive,noodp,nosnippet'}
);
答案 1 :(得分:1)
适合我...
在您的示例中,您没有初始化$query
,这可能是问题吗?
use CGI;
use strict;
print
CGI->start_html(-title =>'MyWeb',
-meta => {
-name =>'googlebot',
-content =>'noindex,nofollow,noarchive,noodp,nosnippet'}
);
答案 2 :(得分:1)
这适用于我的机器:
use CGI qw(start_html);
use strict;
use warnings;
print
start_html(-title =>'MyWeb',
-meta => {
'googlebot' => 'noindex,nofollow,noarchive,noodp,nosnippet',
}
);