Skip to search.
modperl · Perl module for Apache

Group Information

? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

  Messages Help
Advanced
a new API proposal for passing $r to CGI.pm/CGI::Cookie   Message List  
Reply Message #47127 of 67621 < Prev |
a new API proposal for passing $r to CGI.pm/CGI::Cookie

Hi Lincoln,

Nick Tonkin is working on the patch to make CGI::Cookie work properly under
modperl 2.0 in pre-response handlers, and the issue of providing the API for
passing $r to CGI.pm and CGI::Cookie has been raised again.

I'm proposing the following API:

- CGI.pm:

CGI->r($r); # for non-OO API

or

my $q = CGI->new;
$q->r($r); # for OO API

- CGI::Cookie

CGI::Cookie::r($r);

or something like that. Though we have to make into an account that CGI.pm
might be used in sub-requests, so we should probably make sure that we aren't
using the wrong global $r.

and this is the implementation for CGI::Cookie (we need a similar one for
CGI.pm). I have also suggested to abstract all the mp functionality in a
separate module e.g., CGI/MP.pm, so we don't have to duplicate and maintain
several copies of the same code. Loading CGI.pm in CGI::Cookie sounds like a
bad idea if CGI is not already used elsewhere, because of the bloat.

package CGI::Cookie;
...
use vars qw($gr); # global $r
# get/set
sub r {
$gr = shift if @_;
return $gr || Apache->request;
}
sub new {
...
if ($MOD_PERL) {
r()->pool->cleanup_register(\&CGI::Cookie::_reset_globals);
}
}
sub _reset_globals { initialize_globals(); }
sub initialize_globals {
$gr = undef;
}



__________________________________________________________________
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




Fri Apr 11, 2003 3:18 am

stas@...
Send Email Send Email

Message #47127 of 67621 < Prev |
Expand Messages Author Sort by Date

Hi Lincoln, Nick Tonkin is working on the patch to make CGI::Cookie work properly under modperl 2.0 in pre-response handlers, and the issue of providing the...
Stas Bekman
stas@... Send Email
Apr 11, 2003
3:18 am

Looks OK, but will need extensive testing. At one point I had a whole scheme worked out for loading different implementation modules as necessary: one for ...
Lincoln Stein
lstein@... Send Email
Apr 11, 2003
5:20 pm

I ran into a bug this morning with CGI.pm 2.92. When using it with mod_perl 1.x, it does not pick up $r correctly because of a problem in the r() method. The...
Perrin Harkins
perrin@... Send Email
Apr 28, 2003
4:53 pm

Hi Perrin, ... Good spot. Do you know how long the problem has been there? 73, Ged....
Ged Haywood
ged@... Send Email
Apr 28, 2003
8:18 pm

Sorry about that. I applied a 3d party patch for an unrelated minor problem and didn't pick up that it made the @ARGV change. This is fixed in version 2.93. ...
Lincoln Stein
lstein@... Send Email
Apr 28, 2003
9:10 pm

Hi all, I'm trying to build mod_perl 1.27 with apache 1.3.27 and perl 5.8.0. I am getting the following error_log after running make test: [Mon Apr 28 22:53:33...
Tom Gazzini
tomg@... Send Email
Apr 28, 2003
10:01 pm

... I can't understand what's the problem that you are having? You've supplied the error_log, which is cool, but not the output of 'make test'. Also don't you...
Stas Bekman
stas@... Send Email
Apr 28, 2003
11:44 pm

... Okay, allow me start again. I'm trying to install mod_perl 1.27 on RH7.2. I've upgraded perl from 5.6.1 to 5.8.0 Firstly, yes I've read the installation...
Tom Gazzini
tomg@... Send Email
Apr 29, 2003
10:21 am

... Do you really require all of that extra configuration? Are you planning to use mod_rewrite and mod_expires? I typically use this one-liner: perl...
Perrin Harkins
perrin@... Send Email
Apr 29, 2003
5:25 pm

Hi Tom, ... That's the way I always do it. ... Get rid of the existing Apache and mod_perl installations, then use whatever file layout you like. ... Hmmmm....
Ged Haywood
ged@... Send Email
Apr 29, 2003
5:30 pm

Tom Gazzini wrote ... have you checked to see what is running on port 8529 ? do you have the RH apache installation on it ? ... why use the redhat layout ?...
Aaron Trevena
aaron.trevena@... Send Email
Apr 29, 2003
5:18 pm

Thanks to all who offered helpful advice, it was much appreciated. I've now got apache/mod_perl installed and running. Of course, Keep It Simple was the...
Tom Gazzini
tomg@... Send Email
Apr 30, 2003
12:17 am

... When you get the "Cannot bind to port XXX, port already in use" error. Use: % ps auxc | grep httpd to find all running httpd processes and % ps auxc | grep...
Stas Bekman
stas@... Send Email
Apr 29, 2003
11:50 pm

... For several hours. A new (fixed) CGI.pm 2.93 is available from CPAN. __________________________________________________________________ Stas Bekman...
Stas Bekman
stas@... Send Email
Apr 28, 2003
11:29 pm

Hi guys, I try to follow your ping-pong games about adding new things to CGI.pm. Since I use the module heavily under mod_perl 1.x, I was kind of startled by...
Frank Maas
frank.maas@... Send Email
Apr 29, 2003
7:54 am

... AFAIK, nothing changes for mod_perl 1.0 users. So it's probably safe to upgrade. However I suppose that you don't update your live service with untested...
Stas Bekman
stas@... Send Email
Apr 29, 2003
8:22 am

... Thanks Stas. I got curious because the bug Perrin found was while using it under MP1 (if I read his post correctly). As for updating... Once in a while I...
Frank Maas
frank.maas@... Send Email
Apr 29, 2003
8:38 am

... It was just a typo... you know one of those moments when a machine think it knows better ;) ... you mean s/downdate/downgrade/? I think you can find...
Stas Bekman
stas@... Send Email
Apr 29, 2003
8:52 am

... Well, the introduction of the new API, doesn't change any of the existing features. CGI/CGI::Cookie use Apache->request for mod_perl, which could be ...
Stas Bekman
stas@... Send Email
Apr 11, 2003
11:13 pm

... I've just read the diff, hadn't tried it yet. It looks good, but there are several things that need more work. In mod_perl 2, ref($r) returns ...
Stas Bekman
stas@... Send Email
Apr 16, 2003
12:55 am

... Alright. Where should I send it? Lincoln, do you want it? ... - nick -- ~~~~~~~~~~~~~~~~~~~~ Nick Tonkin {|8^)>...
Nick Tonkin
nick@... Send Email
Apr 16, 2003
3:47 pm

On Wed, 16 Apr 2003, Stas Bekman wrote: > Nick, it looks like a good time to plug your CGI::Cookie patch in. Lincoln, The attached patch makes CGI::Cookie...
Nick Tonkin
nick@... Send Email
Apr 17, 2003
2:34 am

... I just noticed this ... I've been using $r->headers_in->{'Cookie'} (which works fine apparently) ... is there a problem with that and should I change the...
Nick Tonkin
nick@... Send Email
Apr 17, 2003
2:47 am

... I haven't benchmarked the difference, but I think that get() (the function interface) would be a tiny bit faster than the TIE interface, since the latter ...
Stas Bekman
stas@... Send Email
Apr 17, 2003
5:33 am

... This version of CGI threw an error for me: Can't call method "pool" without a package or object reference at /home/debug/perl/lib/5.8.0/CGI.pm line 316. ...
Nick Tonkin
nick@... Send Email
Apr 17, 2003
7:27 pm

So I don't have mp2 installed and can't directly test any of this. I know it's working ok on mp1. The section in question was submitted by Stas. I hope I...
Lincoln Stein
lstein@... Send Email
Apr 17, 2003
10:13 pm

... Unfortunately someone must notice that a bug report posted to the generic Perl bug database is related to an external module, and then manually forward the...
Jarkko Hietaniemi
jhi@... Send Email
Apr 17, 2003
11:23 pm

Hi Jarkko, CGI::Carp is no longer working consistently for all combinations of Perl and mod_perl versions. One way I have found to solve most of the problems...
Lincoln Stein
lstein@... Send Email
May 5, 2003
9:03 pm

... What seems to be the, umm, confusion? Reading perlfunc and perlvar on the subject I would say that $SIG{__DIE__} should *not* be used currently if one...
Jarkko Hietaniemi
jhi@... Send Email
May 6, 2003
1:42 am
First  | < Prev  |  Next > Last 
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help