in reply to Re: Printing content-type in the proper context
in thread Printing content-type in the proper context

The function prints an entire HTML page. So I am inclined to put the header in the function. Plus, it's more simple for novice users to write:
printHTML();
Instead of using the CGI module and writing:
print header, printHTML();

Replies are listed 'Best First'.
Re^3: Printing content-type in the proper context
by itub (Priest) on Dec 24, 2004 at 14:42 UTC
    HTML and HTTP headers are two different things, so it's a good idea to have them in separate functions. For lazy users, you can provide a wrapper third function which calls both:
    sub print_everything_with_extra_cheese { print header(); print printHTML(); }
    A reply falls below the community's threshold of quality. You may see it by logging in.