automatically send http header

A

Alex Shi

With php you don't need to explicitly send http header before
print or echo. However in perl you need it. Even with mod_perl
you have to issue following before any http output

print "Content-type: text/plain\n\n";

I am just wondering if it possible to add a command in Apache
configuration so that we don't need the line of sending header
in perl script?

Thanks in advance!

Alex Shi
 
M

Matt Garrish

Alex Shi said:
With php you don't need to explicitly send http header before
print or echo. However in perl you need it.

Perl is an all-purpose scripting language, so of course you have to send
your own header. Output goes to STDOUT. If STDOUT happens to be going to a
browser, you have to format your http headers accordingly. It wouldn't make
for a very good language if every time you tried to print to STDOUT an http
header was dumped out (Perl != CGI).
I am just wondering if it possible to add a command in Apache
configuration so that we don't need the line of sending header
in perl script?

You're asking an apache configuration question in a Perl newsgroup. Someone
here might have an answer for you, but you're far more likely to get a
response by posting your question to a newsgroup that deals with apache
configuration issues. There's no harm in trying here (depending on who
responds), but I suspect most people will just ask you what your Perl
question is.

Matt
 
A

A. Sinan Unur

With php you don't need to explicitly send http header before
print or echo. However in perl you need it. Even with mod_perl
you have to issue following before any http output

print "Content-type: text/plain\n\n";

I am just wondering if it possible to add a command in Apache
configuration so that we don't need the line of sending header
in perl script?

You do realize that the content type depends on the type of the content you
want to send, right?

Sinan.
 
T

Thomas Deschepper

[Tuesday 10 February 2004 00:06]Alex Shi ([email protected]) said:
With php you don't need to explicitly send http header before
print or echo. However in perl you need it. Even with mod_perl
you have to issue following before any http output

print "Content-type: text/plain\n\n";

I am just wondering if it possible to add a command in Apache
configuration so that we don't need the line of sending header
in perl script?

Thanks in advance!

Alex Shi

I think this can be achieved by using CGI.pm
 
J

J. Gleixner

[Tuesday 10 February 2004 00:06]Alex Shi ([email protected]) wrote:

With php you don't need to explicitly send http header before
print or echo. However in perl you need it. Even with mod_perl
you have to issue following before any http output

print "Content-type: text/plain\n\n";

I am just wondering if it possible to add a command in Apache
configuration so that we don't need the line of sending header
in perl script?


And your perl question is??? (Hint: You're posting this question to the
wrong group.)

The answer: Yes. Read the mod_perl documentation:
http://perl.apache.org/docs/2.0/user/config/config.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top