What does "print $cgi->header" do?

What does "print $cgi->header" do?

am 21.04.2008 20:45:58 von Jonathan Mast

------=_Part_3882_28716172.1208803558602
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

There is a line in script we have that I find baffling, it is

print $cgi->header;

To me this seems to be printing the results of the header method of the CGI
module to standard output.

Is something else going on here as well?

Thanks

------=_Part_3882_28716172.1208803558602--

Re: What does "print $cgi->header" do?

am 21.04.2008 20:57:00 von chas.owens

On Mon, Apr 21, 2008 at 2:45 PM, Jonathan Mast
wrote:
> There is a line in script we have that I find baffling, it is
>
> print $cgi->header;
>
> To me this seems to be printing the results of the header method of the CGI
> module to standard output.
>
> Is something else going on here as well?
snip

The standard output is the resulting html page when using CGI*.

* http://search.cpan.org/~lds/CGI.pm-3.35/CGI.pm#CREATING_A_ST ANDARD_HTTP_HEADER:


--
Chas. Owens
wonkden.net
The most important skill a programmer can have is the ability to read.

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

Re: What does "print $cgi->header" do?

am 21.04.2008 20:57:50 von krahnj

Jonathan Mast wrote:
> There is a line in script we have that I find baffling, it is
>
> print $cgi->header;
>
> To me this seems to be printing the results of the header method of the CGI
> module to standard output.

Correct.


> Is something else going on here as well?

That depends on what the currently selected filehandle is and what the
values of $\ and $, are.



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/