replace: my $output = "Content-type: text/html\n\n"; with: print "Content-type: text/html\n\n";