Update:Since you are just creating a flat HTML file and not streaming this to the browser via CGI, you don't need a header at all. So you can just remove the bits printing the 'Content-Type'. Printing out the header is only needed if you are generating a dynamic page.
You need to print that header into the file as well. As it is, the header is just going to the terminal so it doesn't get saved in the top of the file. Try this:
#!/usr/bin/perl
use strict;
use warnings;
my $outname = "/usr/anil/scripts/myhtml.html";
open HTML, '>', $outname or die "Couldn't create '$outname': $!";
print HTML "<html>\n";
print HTML "<head>\n";
print HTML "<title>My Home Page</title>";
print HTML "</head>\n";
print HTML "<body bgcolor = blue>\n";
print HTML "
<p>Here we have an HTML page with a paragraph.</p>
";
print HTML "</body>\n";
print HTML "</html>\n";
close (HTML);