Reputation: 64074
I want to include the following HTML meta tag into a cgi script:
<meta name="googlebot" content="noindex,nofollow,noarchive,noodp,nosnippet" />
But why this doesn't print out the result?
use CGI;
print
$query->start_html(-title =>'MyWeb',
-meta => {
-name =>'googlebot',
-content =>'noindex,nofollow,noarchive,noodp,nosnippet'}
),p;
What's the correct way to do it?
Upvotes: 2
Views: 599
Reputation: 9330
use strict;
use warnings;
use CGI;
my $query = CGI->new();
print
$query->start_html(-title =>'MyWeb',
-meta => {'googlebot' => 'noindex,nofollow,noarchive,noodp,nosnippet'}
);
Upvotes: 3
Reputation: 26871
This works on my machine:
use CGI qw(start_html);
use strict;
use warnings;
print
start_html(-title =>'MyWeb',
-meta => {
'googlebot' => 'noindex,nofollow,noarchive,noodp,nosnippet',
}
);
Upvotes: 1
Reputation: 262834
Works for me...
In your example, you did not initialize $query
, could that be the problem?
use CGI;
use strict;
print
CGI->start_html(-title =>'MyWeb',
-meta => {
-name =>'googlebot',
-content =>'noindex,nofollow,noarchive,noodp,nosnippet'}
);
Upvotes: 1