Yes, your proposal works. But I'm working in an EBCDIC platform, so I
shouldn't use ASCII values in the perl-scripts, all must be EBCDIC. As you
say \r and \n are platform dependent, so source programs should use "\r" and
"\n" in order that the sources are platform independent. Looking some
sources in mod_perl and apache, they are using these values "\n" and "\r".
But somewhere something is wrong and I need to find where.
        
        I'm not familiar with EBCDIC, but in Perl \r and \n are platform
        dependent, you migh want to try the platform independent \015 (cr)
        and \012 (lf). 

        [EMAIL PROTECTED] wrote:
        > 
        > Dear list readers - 
        > 
        > I'm working with the following environment:
        > 
        > BS2000-Posix as O.S.
        > Perl-5.005_54
        > Apache-1.3.9
        > Mod_perl-1.21
        > 
        > BS2000-Posix has the EBCDIC as character set, both Apache-1.3.9
and
        > perl-5.005_54 are ported to support EBCDIC code.
        > 
        > I installed Apache with mod_perl and tried the counter example of
the
        > mod_perl guide:
        > 
        > #!/usr/local/bin/perl -w                              
        > use strict;                                           
        >                                                       
        > print "Content-type: text/html\r\n\r\n";              
        >                                                       
        > my $counter = 0;                                      
        >                                                       
        > for (1..5) {                                          
        >   increment_counter();                                
        > }                                                     
        >                                                       
        > sub increment_counter{                                
        >   $counter++;                                         
        >   print "Counter is equal to ..... $counter !<BR>\n"; 
        > }
        > 
        > The result that I have is:
        > 
        > HTTP/1.1 200 OK                                             
        > Date: Mon, 15 Nov 1999 09:36:57 GMT                         
        > Server: Apache/1.3.9 (BS2000) mod_perl/1.21 ApacheJServ/1.0 
        > Connection: close                                           
        > Content-Type: text/plain                                    
        >                                                             
        > Counter is equal to ..... 1 !<BR>                           
        > Counter is equal to ..... 2 !<BR>                           
        > Counter is equal to ..... 3 !<BR>                           
        > Counter is equal to ..... 4 !<BR>                           
        > Counter is equal to ..... 5 !<BR>                           
        > Connection closed by foreign host.
        > 
        > The content-type is text/plain instead text/html, mod_perl loses
this header
        > probably due to EBCDIC conversion of the "\n" character. Trying
with
        > print "Content-type: text/html\r\n";
        > or with
        > print "Content-type: text/html\r\r\n";
        > the content-type is text/html, as it should be.
        > 
        > I looked the sources of mod_perl for some part where the mod_perl
is
        > preparing the headers from the output of perl5 and to pass them to
the
        > apache. I don't understand who is doing that. Can someone help me
to find
        > where the content-type header is lost.
        > 
        > -- Ignasi Roca
        

Reply via email to