http://qs321.pair.com?node_id=115347


in reply to Re: Why would you want to print duplicate headers?
in thread Why would you want to print duplicate headers?

I assume that bothering to check that CGI hasn't printed the headers already was added as an option recently, I don't think it use to do this.

It presumably takes a tiny bit more code and hence time to do the check so not checking may make your scripts a fraction faster - though I doubt you'd notice.

Secondly if for some strange reason you wanted to print headers several times, and you updated your copy of CGI and this was now the default, you'd be unhappy. So I'd guess that Lincon made it an option, and possibly at some point it will become the default. There are other things that CGI.pm does that are better for backwards compatability than actual saftey.

There are several things you can do to CGI.pm that are wise but not set by default, see Re: CGI::Safe and easy file uploading and Preventing DOS attacks with CGI.pm.

Finally, as strange as it seems, sometime it's useful to force your headers twice, so you can quickly see what your headers are, well the second set...