Re: mod_perl STDOUT on OS X Panther
- Danial Pearce wrote:
> So I bought Panther the other day. Turns out apple have done the rightIf you rely on Apache for your business I would go with your hand-made latest
> thing this time and shipped with the latest Apache. Which is great, I
> remember the rigmarole I went through with Jaguar to get a working
> Apache/mod_perl/libapreq set up. However, they have not shipped the
> latest mod_perl.
> A quick look with Apache::Status tells me that it's 1.26 compiled with
> My issue is, in a PerlHandler, usually doing print "foo\n" will print it
> to the browser. This is not happening with the default Panther install.
> I can fix this by changing the call to $r->print("foo\n") instead, but
> there are just so many places I would have to change it.
> I can also fix it by installing mod_perl 1.29, which also works fine,
> but if possible I would like to keep to what Apple ship, so I don't
> inadvertently break my entire set up when they release a patch.
version of Apache/mod_perl and not depend on your distro precompiled thing.
> Any ideas why the normal STDOUT is not the browser? Is there a globalSTDOUT is normally tied to the 'Apache' class. I don't know why it doesn't
> place I can tie it in? E.g. Load some other perlhandler early on in the
> peace so that it gets tied properly for all subsequent perlhandlers?
work for you in 1.26. It's possible that you run some code that
re-ties/re-opens STDOUT to something else, but that is probably not a case,
since you say it's working fine with 1.29.
But you could fix it in PerlTransHandler or some earlier phase, like so:
tie STDOUT, 'Apache' unless tied STDOUT;
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@... http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com