You will be warned for your question format.

There seems 2 problems, one is about error log and anothoer is about here document like printing. At first, your program prints anything or not? If you pickup troubled lines into sample script, I can know your $r->print() prints anything or not... at least in my environment.

I can print $r->print with configuration like this.

#mod_perl test LoadModule perl_module /usr/local/libexec/apache22/mod_perl.so #there should be better way than this... <Perl> unshift @INC, '/usr/local/www/apache22/cgi-bin/test-modperl'; </Perl> PerlModule test1::sample <Directory /usr/local/www/apache22/cgi-bin/test-modperl/test1> SetHandler perl-script PerlHandler test1::sample </Directory>
And $r->print in test1/sample.pm prints my text. I'm on FreeBSD 8.2, mod_perl2.0.5 .
package test1::sample; use strict; use warnings; #old use Apache::Constants qw(OK); use Apache2::Const qw(OK); use Apache2::RequestRec(); use Apache2::RequestIO(); sub handler { my $r=shift; #old $r->send_http_header("text/plain"); $r->content_type("text/plain"); my $a=<<EOS test test test EOS ; $r->print($a); return OK; } 1;
good luck for you. regards.


In reply to Re: maybe using $r->print() instead of print under mod_perl by remiah
in thread maybe using $r->print() instead of print under mod_perl by askgetanswer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.