Re: Bug with cgi->header() + mod_perl ?

2009-02-20 Thread Mark Hedges
On Sat, 14 Feb 2009, Patrick Galbraith wrote: > Thanks - as soon as I read what you said, I looked at the > code and saw I instantiated a CGI object at the top of the > script, package-scoped so I wouldn't have to pass it > between subroutines. I thought I would test this intuition > by instantia

Re: Bug with cgi->header() + mod_perl ?

2009-02-15 Thread Perrin Harkins
In the code you showed, nothing calls sub1, so I wasn't sure what you were thinking would happen there. If your real code does call it first on every request, then it should work. There's no need to worry about concurrency. Even when using threads, each interpreter is separate and nothing is sha

Re: Bug with cgi->header() + mod_perl ?

2009-02-15 Thread André Warnier
Sorry, this list does not automatically set the reply-to, and I always forget.. Perrin Harkins wrote: On Sat, Feb 14, 2009 at 5:50 AM, André Warnier wrote: Less nice, less neat, less classic, terrible style, whatever you want, but which also works : Yeah, I wouldn't really recommend this.

Re: Bug with cgi->header() + mod_perl ?

2009-02-15 Thread Perrin Harkins
On Sat, Feb 14, 2009 at 5:50 AM, André Warnier wrote: > Less nice, less neat, less classic, terrible style, whatever you want, but > which also works : Yeah, I wouldn't really recommend this. Passing your $cgi object to subs that need it is the best solution. > I am not quite sure why it works,

Re: Bug with cgi->header() + mod_perl ?

2009-02-14 Thread André Warnier
Patrick Galbraith wrote: [...] Hi. Less nice, less neat, less classic, terrible style, whatever you want, but which also works : # my nifty cgi-bin use strict; use warnings; { package MyOwn; no strict; $CGI = ''; } sub sub1 { $MyOwn::CGI = new CGI(); } sub sub2 { my $name = $MyOwn::CG

Re: Bug with cgi->header() + mod_perl ?

2009-02-14 Thread Patrick Galbraith
Perrin, Thanks - as soon as I read what you said, I looked at the code and saw I instantiated a CGI object at the top of the script, package-scoped so I wouldn't have to pass it between subroutines. I thought I would test this intuition by instantiating in the method that needed it, and pass

Re: Bug with cgi->header() + mod_perl ?

2009-02-12 Thread Perrin Harkins
On Tue, Feb 10, 2009 at 10:44 PM, Patrick Galbraith wrote: > After looking at it in gdb, I noticed it has something to do with > Apache2::RequestRec, the header in particular. My guess is that you're keeping an old CGI or $r object around between requests, or that this is some kind of special sce

Bug with cgi->header() + mod_perl ?

2009-02-10 Thread Patrick Galbraith
Hello all, I'm writing about the benefits of mod_perl in my book, having taken a CGI script and using ModPerl::Registry turning it into a mod_perl app... so on so forth... While testing what I'm writing about, I keep seeing segfaults in my apache log. I started worrying that I have a bug in D