perl - malformed header from script. Bad header=<!DOCTYPE html> -


i receiving following server error on perl script:

malformed header script. bad header=: youtube_perl.pl,

here source code:


#!"c:\xampp\perl\bin\perl.exe" -t  use strict; use warnings;  use cgi; use cgi::carp qw/fatalstobrowser/; use www::mechanize;  $q = cgi->new;  $url = 'http://www.youtube.com';  $mechanize = www::mechanize->new(autocheck => 1);  $mechanize->get($url);  $page = $mechanize->content();  print $page; 

thanks in advance!

figured out. had add following before attempted print page:

print "content-type: text/html\n\n"; 

i guess perl can not print html pages without defining header first.


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -