Re: Usefulness of $r->notes and $r->pnotes (or $c)

2010-03-24 Thread Fred Moyer
hing that might involve keep alive connections: where the same >>> connection serves multiple requests. Probably not that useful for HTTP, >>> but might be for other protocols. >>> >> >> Fred did something fancy (connection rate limiting) with $c->pnotes >

Re: Usefulness of $r->notes and $r->pnotes (or $c)

2010-03-24 Thread Michael Ludwig
Am 24.03.2010 um 15:20 schrieb Douglas Sims: > We use the notes table to put a reference to the session (and thus the user) > in the access log. > > $request->notes->set('session' => $session->{SESSION}); > > This is in apache2.conf: > > LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer

Re: Usefulness of $r->notes and $r->pnotes (or $c)

2010-03-24 Thread Douglas Sims
e. > > First, ModPerl::MethodLookup::lookup_method( $symbol ) is a really great > help for exploring the API! > > m...@colinux:~ > perl aplkp.pl notes > There is more than one class with method 'notes' > try one of: >use Apache2::RequestRec (); >

Re: Usefulness of $r->notes and $r->pnotes (or $c)

2010-03-24 Thread Perrin Harkins
re. Some people have plenty of headroom for mod_perl processes but can't allow frequent access to a shared resource like a fragile database. The request pnotes is commonly used to pass information between handlers in different phases. I haven't seen much use of the connection pnotes. - Perrin

Re: Usefulness of $r->notes and $r->pnotes (or $c)

2010-03-24 Thread Michael Ludwig
ion serves multiple requests. Probably not that useful for HTTP, >> but might be for other protocols. >> > > Fred did something fancy (connection rate limiting) with $c->pnotes > recently. see his post about it here: > > http://marc.info/?l=apache-modperl&a

Re: Usefulness of $r->notes and $r->pnotes (or $c)

2010-03-23 Thread Adam Prime
. Fred did something fancy (connection rate limiting) with $c->pnotes recently. see his post about it here: http://marc.info/?l=apache-modperl&m=124217947427395&w=2

Re: Usefulness of $r->notes and $r->pnotes (or $c)

2010-03-23 Thread Michael Peters
On 03/23/2010 05:28 PM, Michael Ludwig wrote: What could be done at the connection level? Anything that might involve keep alive connections: where the same connection serves multiple requests. Probably not that useful for HTTP, but might be for other protocols. -- Michael Peters Plus Thre

Usefulness of $r->notes and $r->pnotes (or $c)

2010-03-23 Thread Michael Ludwig
2::Connection (); m...@colinux:~ > perl aplkp.pl pnotes There is more than one class with method 'pnotes' try one of: use Apache2::RequestUtil (); use Apache2::ConnectionUtil (); Good. Now to the point. We have ->notes and ->pnotes on the request and conn

Re: Connection rate limiting with Apache2::ConnectionUtil pnotes

2009-05-12 Thread Philippe M. Chiasson
On 12/05/09 21:50 , Fred Moyer wrote: > Greetings, > > I ran into an issue today where I had a load surge in my application > server, so I looked around for a suitable throttling module and didn't > see anything simple. I personally have used mod_cband quite successfully for stuff like this, give

Connection rate limiting with Apache2::ConnectionUtil pnotes

2009-05-12 Thread Fred Moyer
Greetings, I ran into an issue today where I had a load surge in my application server, so I looked around for a suitable throttling module and didn't see anything simple. So I put together this snippet (very rough) which uses the connection pnotes data structure to track how many request

Re: Passing $r->pnotes on $r->internal_redirect

2006-12-20 Thread Fred Moyer
Fred Moyer wrote: Greetings, I have a handler that calls $r->internal_redirect('/new/location'). I want to avoid recomputing the data I have in $r->pnotes at the time of the redirect, and instead magically pass that pnotes data to the $r in the new handler somehow. I

Passing $r->pnotes on $r->internal_redirect

2006-12-20 Thread Fred Moyer
Greetings, I have a handler that calls $r->internal_redirect('/new/location'). I want to avoid recomputing the data I have in $r->pnotes at the time of the redirect, and instead magically pass that pnotes data to the $r in the new handler somehow. I can stash the $r-&g

Re: Apache::DBI and pnotes

2006-10-02 Thread Jonathan Vanasco
On Oct 2, 2006, at 5:31 PM, Michael Peters wrote: does apache::dbi ping a connection then reconnect if the ping fails? If you call DBI->connect it does. awesome. i never knew that.

Re: Apache::DBI and pnotes

2006-10-02 Thread Michael Peters
Jonathan Vanasco wrote: > > On Oct 2, 2006, at 4:01 PM, Michael Peters wrote: > >> The main problem with this is that if you loose your db connection >> somehow, you >> wouldn't know until it bombed out on you unless you constantly check it >> everytime before you use it. > > does apache::dbi

Re: Apache::DBI and pnotes

2006-10-02 Thread Jonathan Vanasco
On Oct 2, 2006, at 4:01 PM, Michael Peters wrote: The main problem with this is that if you loose your db connection somehow, you wouldn't know until it bombed out on you unless you constantly check it everytime before you use it. does apache::dbi ping a connection then reconnect if the p

Re: Apache::DBI and pnotes

2006-10-02 Thread Michael Peters
Jonathan Vanasco wrote: > but storing pnotes is just > > handler 1 > $r->pnotes( 'database_connect'=> $database_connect ); > > handler 2 > my $database_connect = $r->pnotes('database_connect'); The main problem with this is

Re: Apache::DBI and pnotes

2006-10-02 Thread Jonathan Vanasco
d have such code, and then use pnotes to export $database_connect variable to other handlers. Could anyone give me any example of such tasks ? if you are using apache::dbi, you can just repeatedly call connect-- apache::dbi will catch the connect and just toss you back the existing conne

Apache::DBI and pnotes

2006-10-02 Thread Vladimir S. Tikhonjuk
onnect to database: ".$DBI::errstr; As I understand, I may write a handler, which would have such code, and then use pnotes to export $database_connect variable to other handlers. Could anyone give me any example of such tasks ? Best regards, Vladimir S. Tikhonjuk

Re: [QUESTION] pnotes, Template-Toolkit, and a memory leak

2006-06-30 Thread Philip M. Gollucci
STROY is called. pnotes() is special in that it doesn't create a copy of the variable (depending on how you use it) it just does an SvREF_inc() on the HV. So when you delete it from the pnotes, you might be trigger more then you think (agreeing with Johnathna's though that Bugzilla i

Re: [QUESTION] pnotes, Template-Toolkit, and a memory leak

2006-06-30 Thread Max Kanat-Alexander
On Fri, 2006-06-30 at 18:49 -0400, Jonathan Vanasco wrote: > I think its more likely that the bug is in the way Bugzilla uses TT > -- a some reference to the template object is getting stored > persistently ( i think everyone has made a similar mistake ). I've > never had a problem with a pn

Re: [QUESTION] pnotes, Template-Toolkit, and a memory leak

2006-06-30 Thread Jonathan Vanasco
On Jun 30, 2006, at 6:20 PM, Max Kanat-Alexander wrote: On Fri, 2006-06-30 at 00:37 -0400, Perrin Harkins wrote: HOWEVER: If I "delete $r->pnotes->{template}" before the script ends, there's no memory leak. It sounds like a problem with the DESTROY method in Templ

Re: [QUESTION] pnotes, Template-Toolkit, and a memory leak

2006-06-30 Thread Max Kanat-Alexander
On Fri, 2006-06-30 at 00:37 -0400, Perrin Harkins wrote: > > HOWEVER: If I "delete $r->pnotes->{template}" before the script ends, > > there's no memory leak. > > It sounds like a problem with the DESTROY method in Template::Provider. > Can you ad

Re: [QUESTION] pnotes, Template-Toolkit, and a memory leak

2006-06-29 Thread Perrin Harkins
Max Kanat-Alexander wrote: I store a Template object inside of $r->pnotes(). [...] Every time I reload the script, the process uses an *additional* 512K of RAM, forever, on and on, until my server runs out of memory. HOWEVER: If I "delete $r->pnotes->{tem

[QUESTION] pnotes, Template-Toolkit, and a memory leak

2006-06-29 Thread Max Kanat-Alexander
I have httpd-2.0.52-22 from RHEL4 (Red Hat Enterprise Linux 4) for my Apache. My perl is also 5.8.5, from RHEL4. (The server is a RHEL4 server.) All my testing was in a single-process prefork server, running as "httpd -X". I store a Template object inside of $r-&

Re: pnotes MP1->MP2

2006-04-03 Thread Torsten Foertsch
intError => 0}) >            || return "Error connecting.\n$DBI::errstr\n"; >    } > >    $r->pnotes(DBH => $dbh); > } does it make a difference if $r->pnotes(DBH => $dbh); is changed into $r->pnotes->{DBH} = $dbh; ? Torsten pgpnMIStslhzY.pgp Description: PGP signature

Re: pnotes MP1->MP2

2006-04-03 Thread Jeff Armstrong
Original Message From: John Russell <[EMAIL PROTECTED]> Cc: modperl@perl.apache.org Subject: Re:pnotes MP1->MP2 Date: Mon Apr 03 2006 20:08:13 Here's the whole entry in the apache error_log [Mon Apr 03 05:00:35 2006] [error] access to /home/httpd/htdocs/com.onlywebdata.mc3/

re: pnotes MP1->MP2

2006-04-03 Thread John Russell
Thank you for your help, a workaround has been found. The cause of failure seems to be using pnotes in a subroutine called by the handler. It is easy enough to work around the problem by avoiding the subroutine. Forgive me if I've wasted the list's time with poor coding but perhaps i

Re: pnotes MP1->MP2

2006-04-03 Thread Issac Goldstand
It should work fine. I wrote the same thing today (albeit without method calls)... # Trans handler sub lookup_handler { my $r=shift; my $dbh=GTS::Util::connectdb(); # essentially a wrapper for DBI->connect ... $r->pnotes(dbh=>$dbh); return Apache2::Const::DECLINED; } #

Re: pnotes MP1->MP2

2006-04-03 Thread John Russell
Geoff, Sorry I'm not familiar with Apache2::TestModperl search.cpan.org gives no hits for Apache2 TestModperl How do I use this test to identify the problem with MP2 pnotes? I'm using httpd-2.0.55 mod_perl-2.0.2 but can work with any trusted version. If I comment out the line # my

Re: pnotes MP1->MP2

2006-04-03 Thread John Russell
Thank you. Tried it, unfortunately no difference. I'll try Geoffrey Young's test. On Apr 3, 2006, at 12:08 PM, Torsten Foertsch wrote: On Monday 03 April 2006 20:20, John Russell wrote: sub handler($$) { http://perl.apache.org/docs/2.0/user/porting/ porting.html#Method_Handlers maybe that

Re: pnotes MP1->MP2

2006-04-03 Thread Geoffrey Young
John Russell wrote: > In MP1 it was possible to do.. > > Authorization Phase > > sub handler { > > my $dbh; > > $dbh = DBI->connect(..) > || return "Error connecting.\n $DBI::errstr\n"; > > $r->pnotes(DBH => $dbh); >

Re: pnotes MP1->MP2

2006-04-03 Thread Torsten Foertsch
On Monday 03 April 2006 20:20, John Russell wrote: > sub handler($$) { http://perl.apache.org/docs/2.0/user/porting/porting.html#Method_Handlers maybe that is your problem. Torsten pgpLWFPZiFN26.pgp Description: PGP signature

Re: pnotes MP1->MP2

2006-04-03 Thread John Russell
Tom, Thanks for your help. I've only ever used pnotes to pass this DBI object so I've not had experience with other items. It worked fine in MP1. I tried adding use Apache2:RequestUtil(); to the existing entry in startup.pl use Apache2::RequestRec (); but it did not make any

Re: pnotes MP1->MP2

2006-04-03 Thread Tom Schindl
Is this only the case for DBI-Instances? I've been passing objects using pnotes for quite a while in my apps and never had any problems. What your the ... in your error message? Could you shown me the whole code you are using maybe you forgot to load Apache2::RequestUtil? http://perl.apach

Re: pnotes MP1->MP2

2006-04-03 Thread John Russell
Tom, under MP2 $r->pnotes(DBH => $dbh); gives failed for ..., reason: DBI::db=HASH(0x97c720c) and also the same error with Apache2::SafePnotes. Hence the reason to try de-referencing the hash. Thank you, John. On Apr 3, 2006, at 11:32 AM, Tom Schindl wrote: John Russell wrote: In

Re: pnotes MP1->MP2

2006-04-03 Thread Tom Schindl
John Russell wrote: > In MP1 it was possible to do.. > > Authorization Phase > > sub handler { > > my $dbh; > > $dbh = DBI->connect(..) > || return "Error connecting.\n $DBI::errstr\n"; > > $r->pnotes(DBH => $dbh); > >

pnotes MP1->MP2

2006-04-03 Thread John Russell
In MP1 it was possible to do.. Authorization Phase sub handler { my $dbh; $dbh = DBI->connect(..) || return "Error connecting.\n $DBI::errstr\n"; $r->pnotes(DBH => $dbh); Response Phase sub handler($$) { my $dbh = $r->pnotes('DBH'); However

Re: [MP2] possible pnotes bug?

2006-03-16 Thread Torsten Foertsch
t; > example. > > ook, my bad - I thought the proposed "solution" was to always dereference > pnotes behind the scenes, making the additional storage a requirement. > > but, just in case I'm not the only one confused, I'd propose a path like > this... > &g

Re: [MP2] possible pnotes bug?

2006-03-15 Thread Torsten Foertsch
On Wednesday 15 March 2006 18:55, Perrin Harkins wrote: > On Wed, 2006-03-15 at 12:23 -0500, Geoffrey Young wrote: > > I actually thing that would be somewhat common. and as I understand > > things, the fix would require the middle step to be > > > > -- next handl

Re: [MP2] possible pnotes bug?

2006-03-15 Thread Torsten Foertsch
On Wednesday 15 March 2006 18:23, Geoffrey Young wrote: > > + my $foo = 123; > > + $r->pnotes('foo' => $foo); > > + $foo = 456; > > + $r->pnotes('foo') # <== now 456 (in 2.0.2) > > + $r->pnotes('foo') # <== left at 12

Re: [mp1] intermittant pnotes error

2006-03-14 Thread Ben Kim
I have an odd problem and would like to have advice. I posted it to alt.apache.configuration  but only got an advice to submit it as a bug. I'd appreciate any help. My Apache is Apache/2.0.55 (Unix) Embperl/2.1.0 mod_perl/2.0.2 Perl/v5.8.7 on Solaris.

RE: [mp1] intermittant pnotes error

2006-03-13 Thread Adam Prime x443
onday, March 13, 2006 4:03 PM To: Adam Prime x443 Cc: modperl@perl.apache.org Subject: RE: [mp1] intermittant pnotes error On Mon, 2006-03-13 at 15:57 -0500, Adam Prime x443 wrote: > The thing the puzzles me the most is that everything runs fine 99.9% > of the time. I'm kind of at a l

RE: [mp1] intermittant pnotes error

2006-03-13 Thread Perrin Harkins
On Mon, 2006-03-13 at 15:41 -0500, Adam Prime x443 wrote: > this is the the conf for that particular case of the error: > > > SetHandler perl-script > PerlHandler StrategyV2::Careers > Looks okay. > I don't really understand method handlers and their applications, and >

RE: [mp1] intermittant pnotes error

2006-03-13 Thread Adam Prime x443
3, 2006 3:08 PM To: Adam Prime x443 Cc: modperl@perl.apache.org Subject: Re: [mp1] intermittant pnotes error On Mon, 2006-03-13 at 11:00 -0500, Adam Prime x443 wrote: > The code that causes this error (in this example anyway, it has > happened on practically every package) is this: > &g

RE: [mp1] intermittant pnotes error

2006-03-13 Thread Perrin Harkins
On Mon, 2006-03-13 at 15:57 -0500, Adam Prime x443 wrote: > The thing the puzzles me the most is that everything runs fine 99.9% > of the time. I'm kind of at a loss about what I should even log aside > from the process_id. You should log what $r is, since it isn't what you thought it was. You m

RE: [mp1] intermittant pnotes error

2006-03-13 Thread Adam Prime x443
ies, or if it's something that happens across processes. Adam -Original Message- From: Perrin Harkins [mailto:[EMAIL PROTECTED] Sent: Monday, March 13, 2006 3:48 PM To: Adam Prime x443 Cc: modperl@perl.apache.org Subject: RE: [mp1] intermittant pnotes error On Mon, 2006-03-13 at 15:

Re: [mp1] intermittant pnotes error

2006-03-13 Thread Perrin Harkins
On Mon, 2006-03-13 at 11:00 -0500, Adam Prime x443 wrote: > The code that causes this error (in this example anyway, it has > happened on practically every package) is this: > > sub handler{ > my $r = shift; > my $req = Apache::Request->instance($r); > . > } Why don't you put some

[mp1] intermittant pnotes error

2006-03-13 Thread Adam Prime x443
I have this problem where we get a series of errors like this: [Sun Mar 12 16:29:23 2006] [error] Can't locate object method "pnotes" via package "StrategyV2::Careers" at /usr/lib/perl5/site_perl/5.8.5/i686-linux/Apache/Request.pm line 36.\n but where the package

Re: [MP2] possible pnotes bug?

2006-01-10 Thread Torsten Foertsch
to understand why it is a feature and cannot see the point. I'm asking because your Apache2::Connection::pnotes patch also implements this feature. Torsten pgpEAOgjnjaUS.pgp Description: PGP signature

Re: [MP2] possible pnotes bug?

2006-01-10 Thread Geoffrey Young
Nevertheless, I really think it is a bug, since it provokes action at a distance. I think it's best filed under "feature" - the mp1 behavior is not going to change and has been more than ok for years and years now, and it's priobably better to have mp1 and mp2 be in sync here in the princip

Re: [MP2] possible pnotes bug?

2006-01-10 Thread Philip M. Gollucci
Torsten Foertsch wrote: How about that? Committed revision 367709 Thanks! -- "Love is not the one you can picture yourself marrying, but the one you can't picture the rest of your life without." "It takes a minute to h

Re: [MP2] possible pnotes bug?

2006-01-10 Thread Torsten Foertsch
gt; for the record, this behavior is the same across mp1 and mp2.  although I > don't recall anyone being confused by this in mp1 land, it might be nice to > expand the docs there as well. Nevertheless, I really think it is a bug, since it provokes action at a distance. Suppose my $x=&qu

Re: [MP2] possible pnotes bug?

2006-01-10 Thread Geoffrey Young
I don't recall anyone being confused by this in mp1 land, it might be nice to expand the docs there as well. for the interested http://people.apache.org/~geoff/pnotes-bug.tar.gz Apache-Test++ ;) --Geoff

Re: [MP2] possible pnotes bug?

2006-01-10 Thread Torsten Foertsch
pache2/RequestUtil.pod 2006-01-10 10:53:47.995798724 +0100 @@ -714,6 +714,19 @@ $val = $r->pnotes($key); $hash_ref = $r->pnotes(); +B sharing variables really means it. The variable is not copied. +Only its reference count is incremented. If it is changed after being +put in pnotes that

Re: [MP2] possible pnotes bug?

2006-01-09 Thread Philip M. Gollucci
John ORourke wrote: Torsten wasn't changing the value pointed to by $ctx, he was changing $ctx - therefore it looks like pnotes actually stores a reference to the scalar you give it, instead of the actual scalar itself as the docs imply. So I'd say it's a doc bug, but I

Re: [MP2] possible pnotes bug?

2006-01-09 Thread Torsten Foertsch
1,two=>2}; >                         $r->pnotes('x',$tmp); >                 } >                 { >                         my $tmp='nothing'; >                         print Dumper($r->pnotes('x'))."\n\n"; >            

Re: [MP2] possible pnotes bug?

2006-01-09 Thread John ORourke
Torsten wasn't changing the value pointed to by $ctx, he was changing $ctx - therefore it looks like pnotes actually stores a reference to the scalar you give it, instead of the actual scalar itself as the docs imply. So I'd say it's a doc bug, but I'd prefer pnotes to stor

Re: [MP2] possible pnotes bug?

2006-01-09 Thread Clint Edwards
Torsten, Yes this is expected, $ctx contains a reference to an anonymous hash, and when you store the value of $ctx in your pnotes, you are merely storing another reference, therefore whenever the values pointed to by $ctx change, you effectively change what is seen in pnotes. On Mon, 2006-01

[MP2] possible pnotes bug?

2006-01-09 Thread Torsten Foertsch
Hi, consider this handler: sub handler { my $r=shift; $r->content_type('text/plain'); my $ctx={foo=>1, bar=>2}; $r->pnotes(x=>$ctx); $r->print( ">>>>>>>>>>>>>>>>\n".Dumper( $r->

Re: pnotes preserved accross calls?!

2005-12-19 Thread John ORourke
kies { my ($self,$r)[EMAIL PROTECTED]; my $cookies=$r->pnotes('cookies') and return $cookies; $cookies=Apache2::Cookie::Validated->fetch($r,$my_secret_key); $r->pnotes('cookies',$cookies); return $cookies; } (Apache2::Cookie::Validated is a subclass I made which validat

Re: pnotes preserved accross calls?!

2005-12-19 Thread Tom Schindl
A little but more code would be help to see what you are really doing ;-) Tom John ORourke wrote: > Hi perlites, I'm getting my brain twisted here... > > [FYI: Apache 2.0.51, MP 2.0.1, Linux 2.6.5] > > still debugging but it *seems* like $r->pnotes is being preserved

pnotes preserved accross calls?!

2005-12-19 Thread John ORourke
Hi perlites, I'm getting my brain twisted here... [FYI: Apache 2.0.51, MP 2.0.1, Linux 2.6.5] still debugging but it *seems* like $r->pnotes is being preserved between requests (I'm storing a hash ref in it like this: $r->pnotes('cookies',$cookie_hash) Are the

Re: [mp2] pnotes-like facility for $c connection object?

2005-10-30 Thread Geoffrey Young
Philip M. Gollucci wrote: > Geoffrey Young wrote: > >> blarg, that patch was incomplete. here's the right one (I hope). > > > D'oh... If anyone tries to apply this, you have to create the directory > xs/Apache2/ConnectionUtil manually *before* applying otherwise 'patch' > pukes on itself. bl

Re: [mp2] pnotes-like facility for $c connection object?

2005-10-29 Thread Philip M. Gollucci
Geoffrey Young wrote: try this patch, which makes the following possible but more vigorous testing always appreciated. +1 The new tests pass on all of the following combinations for FreeBSD 7.0-current: (perlver-httpdver-mpm) 5.8.7_2.0.49_prefork 5.8.7_2.0.50_prefork 5.

Re: [mp2] pnotes-like facility for $c connection object?

2005-10-29 Thread Philip M. Gollucci
Geoffrey Young wrote: blarg, that patch was incomplete. here's the right one (I hope). D'oh... If anyone tries to apply this, you have to create the directory xs/Apache2/ConnectionUtil manually *before* applying otherwise 'patch' pukes on itself. That only took an hour. -- END --

Re: [mp2] pnotes-like facility for $c connection object?

2005-10-29 Thread Philip M. Gollucci
Geoffrey Young wrote: blarg, that patch was incomplete. here's the right one (I hope). I'm apparently missing something obvious here anyone want to tell me what it is cd modperl/trunk patch < ~/dev/patches/conn_pnotes.diff Hmm... Looks like a unified diff to me... The text leading up to

Re: [mp2] pnotes-like facility for $c connection object?

2005-10-25 Thread Geoffrey Young
Torsten Foertsch wrote: > On Tuesday 25 October 2005 20:18, Geoffrey Young wrote: > >> typedef struct { >> MpAV *handlers_connection[MP_HANDLER_NUM_CONNECTION]; >>+HV *pnotes; >> } modperl_config_con_t; > > > Just a thought, will that work with I

Re: [mp2] pnotes-like facility for $c connection object?

2005-10-25 Thread Torsten Foertsch
On Tuesday 25 October 2005 20:18, Geoffrey Young wrote: >  typedef struct { >      MpAV *handlers_connection[MP_HANDLER_NUM_CONNECTION]; > +    HV *pnotes; >  } modperl_config_con_t; Just a thought, will that work with ITHREADS? Torsten pgpv88mJpgw6H.pgp Description: PGP signature

Re: [mp2] pnotes-like facility for $c connection object?

2005-10-25 Thread Geoffrey Young
Geoffrey Young wrote: > > Jeff Ambrosino wrote: > >>I've made great use of $r->pnotes, and now finding myself in need of a >>similar way to stash objects within the connection object. While >>there are regular 'notes' offered by the connection ($c

Re: [mp2] pnotes-like facility for $c connection object?

2005-10-25 Thread Geoffrey Young
Jeff Ambrosino wrote: > I've made great use of $r->pnotes, and now finding myself in need of a > similar way to stash objects within the connection object. While > there are regular 'notes' offered by the connection ($c->notes), > unfortunately there is no

Re: [mp2] pnotes-like facility for $c connection object?

2005-10-24 Thread Geoffrey Young
Jeff Ambrosino wrote: > I've made great use of $r->pnotes, and now finding myself in need of a > similar way to stash objects within the connection object. While > there are regular 'notes' offered by the connection ($c->notes), > unfortunately there is no

[mp2] pnotes-like facility for $c connection object?

2005-10-24 Thread Jeff Ambrosino
I've made great use of $r->pnotes, and now finding myself in need of a similar way to stash objects within the connection object. While there are regular 'notes' offered by the connection ($c->notes), unfortunately there is no 'pnotes'. Any suggestions for a wor

Re: Sth I don't understand about pnotes

2005-09-16 Thread Torsten Foertsch
On Friday 16 September 2005 12:08, Anthony Gardner wrote: > Can s.o. explain what is wrong with the following code > > > $r->pnotes('KEY' => push( @{ $ar }, $some_val ) ); > > because, when it comes to getting the value from > pnotes later with $r->

Re: Sth I don't understand about pnotes

2005-09-16 Thread Anthony Gardner
is wrong with the following > code > > > > > > $r->pnotes('KEY' => push( @{ $ar }, $some_val ) ); > > > > because, when it comes to getting the value from > > pnotes later with $r->pnotes(KEY), it returns > the > > number of

Re: Sth I don't understand about pnotes

2005-09-16 Thread Damyan Ivanov
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Anthony Gardner wrote: > Can s.o. explain what is wrong with the following code > > > $r->pnotes('KEY' => push( @{ $ar }, $some_val ) ); > > because, when it comes to getting the value from > pnotes later

Re: Sth I don't understand about pnotes

2005-09-16 Thread Carl Johnstone
From: "Anthony Gardner" <[EMAIL PROTECTED]> Can s.o. explain what is wrong with the following code $r->pnotes('KEY' => push( @{ $ar }, $some_val ) ); It's a perl problem - not a mod_perl problem. push returns the new number of elements on the a

Sth I don't understand about pnotes

2005-09-16 Thread Anthony Gardner
Can s.o. explain what is wrong with the following code $r->pnotes('KEY' => push( @{ $ar }, $some_val ) ); because, when it comes to getting the value from pnotes later with $r->pnotes(KEY), it returns the number of elements in the array and not the array ref.

Re: pnotes

2004-12-08 Thread Arshavir Grigorian
uld also just use httpd.conf to map locations to modules. Your approach wil work fine though. I am thinking about creating a Template Toolkit object and a DBI handle in Application::handler() and storing it in the request object's pnotes() before dispatching the request. Make sure you

Re: pnotes

2004-12-01 Thread Perrin Harkins
use httpd.conf to map locations to modules. Your approach wil work fine though. I am thinking about creating a Template Toolkit object and a DBI handle in Application::handler() and storing it in the request object's pnotes() before dispatching the request. Make sure you keep the template objec

Re: pnotes

2004-11-30 Thread Bart Simpson
> > Arshavir Grigorian wrote: > > > >> Hello list, > >> > >> I have module called Application which handles > all the requests to > >> the site (except for images, etc) and then > dispatches the request to > >> a different module based on the $r->path_info(). > >> > >> I am thinking about creati

Re: pnotes

2004-11-24 Thread Arshavir Grigorian
kit object and a DBI handle in Application::handler() and storing it in the request object's pnotes() before dispatching the request. The other modules that do the actual work, will then get those 2 "handles" from the request object which is passed to them anyways. Are there any

Re: pnotes

2004-11-24 Thread Stas Bekman
dle in Application::handler() and storing it in the request object's pnotes() before dispatching the request. The other modules that do the actual work, will then get those 2 "handles" from the request object which is passed to them anyways. Are there any problems with this app

pnotes

2004-11-24 Thread Arshavir Grigorian
ler() and storing it in the request object's pnotes() before dispatching the request. The other modules that do the actual work, will then get those 2 "handles" from the request object which is passed to them anyways. Are there any problems with this approach? Thanks. Arshavir

Re: Pnotes in apache2

2004-06-23 Thread Stas Bekman
Stas Bekman wrote: Kreimendahl, Chad J wrote: That's fine... I can definitely live with it. The docs should be updated, though... they say Apache::Table. right, i'll fix that. thanks for the persistence :) Now fixed: http://perl.apache.org/docs/2.0/api/Apache/RequestUtil.html#C_pnotes_ -- _

Re: Pnotes in apache2

2004-06-23 Thread Stas Bekman
Kreimendahl, Chad J wrote: That's fine... I can definitely live with it. The docs should be updated, though... they say Apache::Table. right, i'll fix that. thanks for the persistence :) Though they say APR::Table. Where did you see Apache::Table? -- _

RE: Pnotes in apache2

2004-06-23 Thread Kreimendahl, Chad J
t: Re: Pnotes in apache2 Kreimendahl, Chad J wrote: > ok, but what I'm saying is... pnotes does NOT return an APR::Table > object... it's still working as it did back in mp1. The docs say what > you're saying, but it does not function that way. pnotes() will not return

Re: Pnotes in apache2

2004-06-23 Thread Geoffrey Young
Kreimendahl, Chad J wrote: > ok, but what I'm saying is... pnotes does NOT return an APR::Table > object... it's still working as it did back in mp1. The docs say what > you're saying, but it does not function that way. pnotes() will not return an APR::Table objec

RE: Pnotes in apache2

2004-06-23 Thread Kreimendahl, Chad J
ok, but what I'm saying is... pnotes does NOT return an APR::Table object... it's still working as it did back in mp1. The docs say what you're saying, but it does not function that way. -Original Message- From: Stas Bekman [mailto:[EMAIL PROTECTED] Sent: Wednesday, J

Re: Pnotes in apache2

2004-06-23 Thread Stas Bekman
Kreimendahl, Chad J wrote: So will mp2 pnotes eventually return APR::Table or will it continue to function as it does now (which is the same as mp1)? there is no eventually, the current behavior of modperl-1.99_14 is how it's going to be in mp2. Again the ultimate answer is here:

RE: Pnotes in apache2

2004-06-23 Thread Kreimendahl, Chad J
So will mp2 pnotes eventually return APR::Table or will it continue to function as it does now (which is the same as mp1)? -Original Message- From: Stas Bekman [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 23, 2004 11:57 AM To: Kreimendahl, Chad J Cc: [EMAIL PROTECTED] Subject: Re

Re: Pnotes in apache2

2004-06-23 Thread Stas Bekman
{ my $r = shift; $r->pnotes('key' => "value"); return OK; } By the documentation I assumed the following was the correct way... my $atref = $r->pnotes(); $atref->set('key',"value"); it's APR:

RE: Pnotes in apache2

2004-06-23 Thread Kreimendahl, Chad J
handler { my $r = shift; $r->pnotes('key' => "value"); return OK; } By the documentation I assumed the following was the correct way... my $atref = $r->pnotes(); $atref->set('key',"value"); -

Re: Pnotes in apache2

2004-06-23 Thread Stas Bekman
Kreimendahl, Chad J wrote: Sorry, I mistyped. Was in too much of a hurry to get out of the office. I've set the value of monkey in PerlFixupHandler. Once I get to my PerlResponseHandler and: my $something = $r->pnotes; $something is an unblessed reference (instead of a ref to Tab

RE: Pnotes in apache2

2004-06-19 Thread Kreimendahl, Chad J
Sorry, I mistyped. Was in too much of a hurry to get out of the office. I've set the value of monkey in PerlFixupHandler. Once I get to my PerlResponseHandler and: my $something = $r->pnotes; $something is an unblessed reference (instead of a ref to Table as in

Re: Pnotes in apache2

2004-06-19 Thread Stas Bekman
Kreimendahl, Chad J wrote: Make test does: t/modperl/pnotesok But, when attempting to create a pnotes (which is an APR::Table?) my $hashref = {}; my $pn = $r->pnotes(); my $ret = $pn->set('monkey' => $hashref); $ret is an unblessed hash ref... Should this

Pnotes in apache2

2004-06-17 Thread Kreimendahl, Chad J
Make test does: t/modperl/pnotesok But, when attempting to create a pnotes (which is an APR::Table?) my $hashref = {}; my $pn = $r->pnotes(); my $ret = $pn->set('monkey' => $hashref); $ret is an unblessed hash ref... Should this be blessed

Re: using pnotes to store/retrieve Class::DBI objects?

2003-12-20 Thread Stas Bekman
ieve this Class::DBI object from the Cleanup Handler, the pnotes values are totally gone. However, regular scalers that I've put in 'notes' are still there. Perhaps pnotes has (by design) already been cleaned up prior to the PerlCleanupHan

RE: using pnotes to store/retrieve Class::DBI objects?

2003-12-20 Thread Eric J. Hansen
Hurrah! Its working now. Thank you! Eric > > When I try to retrieve this Class::DBI object from the Cleanup > > Handler, the pnotes values are totally gone. However, > regular scalers > > that I've put in 'notes' are still there. Perhaps pnotes has (by

Re: using pnotes to store/retrieve Class::DBI objects?

2003-12-19 Thread Stas Bekman
Eric J. Hansen wrote: After looking at this further, it turns out that Perrin's suggested code *does* work, but only in the PerlResponseHandler or earlier stages. And unfortunately, I mis-stated the original problem... which is that I am trying to retrieve that pnotes object (Class::DBI ins

RE: using pnotes to store/retrieve Class::DBI objects?

2003-12-19 Thread Eric J. Hansen
After looking at this further, it turns out that Perrin's suggested code *does* work, but only in the PerlResponseHandler or earlier stages. And unfortunately, I mis-stated the original problem... which is that I am trying to retrieve that pnotes object (Class::DBI instanc

  1   2   >