in reply to Re: Learning mod_perl
in thread Learning mod_perl

what was the thing that bite's me most... is that every your page/script runs inside a sub()

This is only true if you're using the mod_perl Apache::PerlRun or Apache::Registry handlers - which are mainly used for the conversion of existing CGI based scripts to run under mod_perl.The CGI to mod_perl Porting of the mod_perl guide covers this.

Once you start writing "native" mod_perl code the problem goes away.

Replies are listed 'Best First'.
Re: Re^2: Learning mod_perl
by bugsbunny (Scribe) on Jul 12, 2003 at 08:39 UTC
    yep that is true, but most of time ppl write scripts directly using some framework like Apache::ASP, Apache::Registry, Apache::Perlrun etc.. instead of writing mod_perl handlers directly...:")
    Even if mod_perl stays the same, just with one simple options it can be done so that ppl may choose between these 2 variants... it is just a matter of string concatenation...
      yep that is true, but most of time ppl write scripts directly using some framework like Apache::ASP, Apache::Registry, Apache::Perlrun etc.. instead of writing mod_perl handlers directly...:")

      I wasn't trying to say that the other frameworks were bad, just that the "wrapped in sub" thing is not always true. It only applies to certain ways of implementing handlers.

      (I'm also not sure that "most" people use these method. You can't really leverage all of the power of mod_perl until you get beyond Apache::Registry and friends. I rarely use them myself.)

      Even if mod_perl stays the same, just with one simple options it can be done so that ppl may choose between these 2 variants... it is just a matter of string concatenation...

      Sorry. No idea what you mean here.

        i mean that it would be fairly easy to change say Apache::Registry so that it can work in one of the two modes i.e. closure/non-closure way..
        'cause it is a matter of different way of concatenation of strings, before compiling the script..