in reply to Web Headers

Instantiate one and only one CGI object and you can ensure that you have unique headers in a couple of different ways.

use CGI qw/:unique_headers/; # or use CGI; $CGI::HEADERS_ONCE = 1; my $query = CGI->new();

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Replies are listed 'Best First'.
Re: Re: Web Headers
by zigdon (Deacon) on Oct 31, 2002 at 19:33 UTC

    Is this documented anywhere? I see it in the CGI.pm file, but not in it's documentation anywhere?

    -- Dan

      Sure it's documented. Just look at the node you replied to :)

      Seriously, I don't know where this is documented. It's just one of those things that you learn after a while. It might even be a debugging tool because frankly, if you can't control when or where your headers are being printed, this means there's a bug somewhere. Documenting features to compensate for buggy code only seems (to me) to encourage such buggy code. However, I do feel that it should be documented with at least a warning that it shouldn't be used unless absolutely necessary.

      Cheers,
      Ovid

      Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.