A ghost in the machine?

2010-01-14 Thread Tosh Cooey
Hi to everyone! I'm trying to find out if I'm passing objects properly under mod_perl because something is not working as I expect. index.pl use MyConfig; my $vars = { config => &cfg }; MyConfig.pm ### package MyConfig; use strict; use Exporter; use vars qw(@ISA @EXPORT %CF

RE: A ghost in the machine?

2010-01-14 Thread Ihnen, David
Global? There's no need to use a global here. You only ever reference %CFG *in* the package... so just make it package scoped - it'll act like a static variable and persist. (scope it with 'my' and remove it from the export) You can always get the value you want with a call to MyConfig::cfg

Re: A ghost in the machine?

2010-01-14 Thread Tosh Cooey
True, good point. I cleaned up my code and changed some things around and I still have the same problem: index.pl use MyConfig; use ClientConf; use MyUser; my $vars = { config => &cfg }; MyConfig.pm ### package MyConfig; use strict; use Exporter; use vars qw(@ISA @EXPORT);

Re: A ghost in the machine?

2010-01-14 Thread Tosh Cooey
Ok now I'm really boggled... If I use: my $vars = { config => &cfg() }; instead of: my $vars = { config => &cfg }; Then it works! So what's the difference between &cfg and &cfg() when it comes to mod_perl, or at least ModPerl::Registry? Thank-you all... Tosh Tosh Cooey wrote: True, good

Re: Apache Blank Pages

2010-01-14 Thread Perrin Harkins
On Wed, Jan 13, 2010 at 5:52 PM, cfaust-dougot wrote: > Below is what I currently call in startup, by any chance does anything pop > out at you? Nope, those all look fine to me. > Other wise I'll start going though them one at a time. A binary search is good for this sort of thing. - Perrin

Re: A ghost in the machine?

2010-01-14 Thread Eric Howe
Hi Tosh, The function sigil ("&") is an archaic left over from before perl5. Calling a function as "&cfg" is the same as saying "&cfg(@_)" and that implicit "@_" was probably the source of your problem. A bit more information can be found here: http://www.perlfoundation.org/perl5/index.cgi?subr

Re: Caveats to using Perl Sections for server configuration?

2010-01-14 Thread Perrin Harkins
I don't use them, but in a startup.pl you would be in a different package. - Perrin On Wed, Jan 13, 2010 at 8:59 PM, Boysenberry Payne wrote: > Do you know if the scope of Perl Sections are the same as when using a > startup.pl? > > -bop > > On Jan 13, 2010, at 2:15 PM, Perrin Harkins wrote: >

RE: Apache Blank Pages

2010-01-14 Thread cfaust-dougot
Thanks Perrin, Long story short, I'm in the process of moving to another machine. I wanted to ask you though, is there any modules I should stay away from loading in startup.pl? Should DBI and DBD be loaded within each script and not within startup? I've always been under the impression that

Re: Apache Blank Pages

2010-01-14 Thread Perrin Harkins
On Thu, Jan 14, 2010 at 6:20 PM, cfaust-dougot wrote: > Long story short, I'm in the process of moving to another machine. I wanted > to ask you though, is there any modules I should stay away from loading in > startup.pl? Should DBI and DBD be loaded within each script and not within > startup?

Re: A ghost in the machine?

2010-01-14 Thread Tosh Cooey
Ha ha! The ghost is me, I'm an archaic leftover! I did say I been in this for 15 years ;) Well Gang, we solved the smaller @_ mystery but not the larger "different behaviour under mod_perl" mystery. I have my bets on it being Old Man Jenkins trying to scare everybody away by wearing a costu

how to modify post data before $r->internal_redirect

2010-01-14 Thread 陈建春
we know apache takes all post form data to sub-request when we do internal redirect, but I will modify some param value and then pass the new value to subrequest, is it possible? -- *陈建春|ChenJianchun* 傲游Web应用部 E-mail: chen...@maxthon.net *Maxthon^? * --每个人的互联网中心! 上网