Re: Announce: Devel::LeakTrace

2002-11-13 Thread Richard Clamp
On Wednesday, Nov 13, 2002, at 17:00 Europe/London, Ben wrote:

I hacked this slightly to use stderr instead of stdout, in an attempt
to make it play nicely with mod_perl, but I'm getting this error:

Can't locate auto/Devel/LeakTrace/show_used.al in @INC (@INC contains: 

@INC path> ) at 
/usr/lib/perl5/site_perl/5.6.0/i386-linux/Devel/LeakTrace.pm line 14
END failed--call queue aborted.

It works fine if called from a normal script.

Any ideas?

My hunch is that the END block is getting triggered before INIT 
somehow, so the show_used symbol isn't getting bootstrapped - see if 
this helps:

Index: LeakTrace.pm
===
--- LeakTrace.pm(revision 910)
+++ LeakTrace.pm(working copy)
@@ -3,9 +3,12 @@
 require 5.006;
 use base 'DynaLoader';

-INIT {
+BEGIN {
 our $VERSION = 0.01;
 bootstrap Devel::LeakTrace $VERSION;
+}
+
+INIT {
 start_up();
 }


Though we should probably take this off list about now...

--
Richard Clamp <[EMAIL PROTECTED]>




Re: Announce: Devel::LeakTrace

2002-11-13 Thread Ben
On Tue, Nov 12, 2002 at 04:50:50PM +, Richard Clamp wrote:
> I just allowed this to escape to CPAN, more information in my use.perl
> journal, and of course the original source.

I hacked this slightly to use stderr instead of stdout, in an attempt
to make it play nicely with mod_perl, but I'm getting this error:

Can't locate auto/Devel/LeakTrace/show_used.al in @INC (@INC contains: INC path> ) at /usr/lib/perl5/site_perl/5.6.0/i386-linux/Devel/LeakTrace.pm line 14
END failed--call queue aborted.

It works fine if called from a normal script.

Any ideas?

Ben 




Re: Apache question

2002-11-13 Thread the hatter
On Wed, 13 Nov 2002, Nick Cleaton wrote:

> Have you tried 

Re: Apache question

2002-11-13 Thread Nick Cleaton
On Wed, Nov 13, 2002 at 03:14:42PM +, Kate L Pugh wrote:
> 
> I have a lightweight server serving static content and server-parsed
> files, and proxying dynamic content through to a mod_perl server.
> Unfortunately the server-parsed pages have '#exec cgi' directives in
> them, and the mod_perl server just isn't seeing those requests.  Am I
> trying to do something impossible?

Have you tried 

Re: Apache question

2002-11-13 Thread Ben
On Wed, Nov 13, 2002 at 03:14:42PM +, Kate L Pugh wrote:
> 
> Can I make apache proxying and server-side includes play nicely together?
> 
> I have a lightweight server serving static content and server-parsed
> files, and proxying dynamic content through to a mod_perl server.
> Unfortunately the server-parsed pages have '#exec cgi' directives in
> them, and the mod_perl server just isn't seeing those requests.  Am I
> trying to do something impossible?
> 
> When I enable ExecCGI on the lightweight server everything works fine
> -- but I don't want that server to be serving out cgi.  And I'm sure
> my rewrite rules are OK because when I turn ExecCGI off again on the
> lightweight server and call the things that are 'exec cgi'ed directly,
> the mod_perl server sees and serves them up fine.
> 
> The interesting parts of the relevant config files are:
> 
> --
> apache_plain.conf:
> 
> # proxying to the mod_perl server
> ProxyRequests off
> ProxyPassReverse /cgi-bin/ http://localhost:82/cgi-bin/
> RewriteEngine on
> # make sure that static and SSI content is served by plain server
> RewriteRule \.(gif|jpg|html|shtml|css|txt)$ - [L]
> RewriteRule ^/(.*\.)(cgi|pl)$ http://localhost:82/$1$2 [P]
> 
> --
> apache_perl_ukps.conf:
> 
> PerlModule Apache::DBI
> PerlModule DBI
> 
>   
> SetHandler perl-script
> PerlHandler Apache::PerlRun
> Options +ExecCGI
> PerlSendHeader On
>   
> 
> Can anyone help?

OK. I'm not that much of an expert, but I'll have a go:

The relevant thing to look at is the include_cgi function of mod_include.c

It works by triggering a GET subrequest for the relevant CGI include.
(Have a look at ap_sub_req_lookup_uri() in http_request.c)

So what we need to do is persuade Apache that this subrequest (which is still
in the URI space of the local server) really wants to be subjected to the
same rules (ie the proxy stuff) as a genuine request. 

Now, IIRC, there *is* a way to do this - for much the same reasons that per-directory
configuration for mod_rewrite works.

I'll have a dig about in the mod_proxy documentation and see how/if subrequests are
made to behave like real requests.

Ben




Apache question

2002-11-13 Thread Kate L Pugh
I ummed and ahhed for a bit before posting this here, since it isn't
about Perl or perlmongers.  But I guess if we can talk about beer and
ADSL, we can talk about apache.

Can I make apache proxying and server-side includes play nicely together?

I have a lightweight server serving static content and server-parsed
files, and proxying dynamic content through to a mod_perl server.
Unfortunately the server-parsed pages have '#exec cgi' directives in
them, and the mod_perl server just isn't seeing those requests.  Am I
trying to do something impossible?

When I enable ExecCGI on the lightweight server everything works fine
-- but I don't want that server to be serving out cgi.  And I'm sure
my rewrite rules are OK because when I turn ExecCGI off again on the
lightweight server and call the things that are 'exec cgi'ed directly,
the mod_perl server sees and serves them up fine.

The interesting parts of the relevant config files are:

--
apache_plain.conf:

# proxying to the mod_perl server
ProxyRequests off
ProxyPassReverse /cgi-bin/ http://localhost:82/cgi-bin/
RewriteEngine on
# make sure that static and SSI content is served by plain server
RewriteRule \.(gif|jpg|html|shtml|css|txt)$ - [L]
RewriteRule ^/(.*\.)(cgi|pl)$ http://localhost:82/$1$2 [P]

--
apache_perl_ukps.conf:

PerlModule Apache::DBI
PerlModule DBI

  
SetHandler perl-script
PerlHandler Apache::PerlRun
Options +ExecCGI
PerlSendHeader On
  

--

I really, really don't want to be serving out the server-parsed files
from the mod_perl server, since this is a very busy site and I'd have
to set MaxClients so high that we'd be out of RAM in no time.  (This
was the rationale behind splitting out the dynamic content -- a high
value for MaxClients on the lightweight server and a lower one on the
bigger mod_perl process.)

Can anyone help?

Kake
-- 
http://www.earth.li/~kake/cookery/ - vegan recipes, now with new search feature
http://grault.net/grubstreet/ - the open-source guide to London
http://www.penseroso.com/ - websites for the fine art and antique trade




Re: Class::DBI trickery

2002-11-13 Thread Tony Bowden
On Wed, Nov 13, 2002 at 12:36:54PM +, Michael Styer wrote:
> > I'd be interested as to why you think it feels backwards...
> Well, if I have a parent object which has a collection of child objects of
> some class (or collections of objects of different classes), it seems like
> the parent should know what it has to do to add a child to (one of) its
> collection(s), as long as you give it the right data for the new child
> object. As it is, the parent can retrive objects it contains but can't add
> more, so the programmer has to know what class the child objects are in
> order to add more of them.

Gotcha. That makes perfect sense! :)

> > I don't think so. Would you mind submitting a patch? 
> Sure. I'll send it off-list unless anyone else is interested.

Great.

> While we're on the subject of Class::DBI, I'm getting deep recursion in
> Class::DBI::DESTROY. It's the call to $self->id at line 501 that seems to
> set it off, but if I take out my triggers it works. Probably something I'm
> doing wrong and I've got the perl debugger on the task, but if anyone has
> any suggestions about where to look I'd love to hear them.

First suggestion is to update to 0.90_05 (available from
www.class-dbi.com), which in the next day or two is going to become
0.90. It gives better error messages for some deep recursion cases that
might help you track the problem better...

If that doesn't help, then feel free to send me your code off-list (or
to the CDBI mailing list), and I'll see if I can spot anything.

Thanks,

Tony




Re: Class::DBI trickery

2002-11-13 Thread Michael Styer
On Wed, 13 Nov 2002, Tony Bowden wrote:

> > I don't like this because I have to hard-code the name of the child
> > class somewhere else besides the has_many initialization statement,
> > and that feels messy. It also just feels backwards.
> 
> I'd be interested as to why you think it feels backwards...

Well, if I have a parent object which has a collection of child objects of
some class (or collections of objects of different classes), it seems like
the parent should know what it has to do to add a child to (one of) its
collection(s), as long as you give it the right data for the new child
object. As it is, the parent can retrive objects it contains but can't add
more, so the programmer has to know what class the child objects are in
order to add more of them.

> > I've overridden 'has_many' with a version that does what I want, but my
> > question is, am I missing a trick? Is there a standard idiom for doing
> > things more or less the way I wanted to within the existing Class::DBI
> > framework?
> 
> I don't think so. Would you mind submitting a patch? 

Sure. I'll send it off-list unless anyone else is interested.

While we're on the subject of Class::DBI, I'm getting deep recursion in
Class::DBI::DESTROY. It's the call to $self->id at line 501 that seems to
set it off, but if I take out my triggers it works. Probably something I'm
doing wrong and I've got the perl debugger on the task, but if anyone has
any suggestions about where to look I'd love to hear them.

Thanks.

michael






Re: Class::DBI trickery

2002-11-13 Thread Tony Bowden
On Tue, Nov 12, 2002 at 07:09:28PM +, Michael Styer wrote:
> I've just been introduced to Class::DBI. While I like it lots in general,
> it seems like it's missing one obvious featur

> So what I wanted to be able to do is this:
> my $survey = Survey->retrieve($survey_id);
> $survey->add_question(\%question_data);
> where the 'add_question' method is created automagically 

Very interesting approach...

> rather than having to do this:
> my $survey = Survey->retrieve($survey_id);
> my $question = Survey::Question->create(\%question_data);
> $question->survey($survey);

Technically, if you were doing it this way, you should probably do:
 my $survey = Survey->retrieve($survey_id);
 my $qn = Survey::Question->create({ %question_data, survey => $survey });

as some databases might complain that you're violating the schema at the
initial create (as your foreign key is null until the next statement).

But I definitely like the first approach.

> I don't like this because I have to hard-code the name of the child
> class somewhere else besides the has_many initialization statement,
> and that feels messy. It also just feels backwards.

I'd be interested as to why you think it feels backwards...

> I've overridden 'has_many' with a version that does what I want, but my
> question is, am I missing a trick? Is there a standard idiom for doing
> things more or less the way I wanted to within the existing Class::DBI
> framework?

I don't think so. Would you mind submitting a patch? 

Thanks,

Tony





RE: st peter's ale

2002-11-13 Thread Billy Abbott
On Wed, 13 Nov 2002, Ivor Williams wrote:

> I don't disapprove of what they have done.

As long as the beer tastes good and they're not putting themselves forward
as something that they're not then their fine with me... they seem to
fulfil those 2 criteria. They've also started up a moderately successful
small brewery, and shown that with the right branding ale does sell - most
impressive.

hmm. talk of beer in the morning makes me thirsty

billy

-- 
"The sky was the colour of television, tuned to a dead whelk"
 Billy Abbott   [EMAIL PROTECTED]





RE: st peter's ale

2002-11-13 Thread Ivor Williams


On Wednesday, November 13, 2002 10:16 AM, Billy Abbott 
[SMTP:[EMAIL PROTECTED]] wrote:
> This seems to be true, and they even happily admit it on their website.
>
> http://www.stpetersbrewery.co.uk/index.htm?p=develop&t=htm
>
> dunno about the outsourcing bit - they claim to brew their beer in a manor
> house in surrey.
>

Actually the brewery is in Suffolk, and it exists, as my brother has visited 
it. Don't know what Camra's line is on St. Peter's Brewery - will check my GBG 
when I get home.





Re: st peter's ale

2002-11-13 Thread Billy Abbott
On Wed, 13 Nov 2002, Simon Wistow wrote:

> > That St. Peter's the branding exercise, right? Boy Jackson has the odd
> > tale to tell...
>
> Hmm. I read a depressing article in a weekend supplement a while back. St.
> Peters was created by the former head of Interbrand (they came up with the
> PriceWaterhouseCoopers - phew, that took some getting out - concept, among
> other pieces of genius...).

This seems to be true, and they even happily admit it on their website.

http://www.stpetersbrewery.co.uk/index.htm?p=develop&t=htm

dunno about the outsourcing bit - they claim to brew their beer in a manor
house in surrey.

I still haven't tried their cask ale...

billy

-- 
"The sky was the colour of television, tuned to a dead whelk"
 Billy Abbott   [EMAIL PROTECTED]





RE: st peter's ale

2002-11-13 Thread Ivor Williams


On Wednesday, November 13, 2002 9:57 AM, Simon Wistow 
[SMTP:[EMAIL PROTECTED]] wrote:
> On another mailing list (I was thinking of you! honest! they meant
> nothing) where we were having the perpetual "What pub shallw e go to
> next" discussion I mentioned The Jerusalem Tavern and said that I liked
> St Peter's ale. I got this reply
>
> - Begin forwarded message -
> > That St. Peter's the branding exercise, right? Boy Jackson has the odd
> > tale to tell...
>
> Hmm. I read a depressing article in a weekend supplement a while back. St.
> Peters was created by the former head of Interbrand (they came up with the
> PriceWaterhouseCoopers - phew, that took some getting out - concept, among
> other pieces of genius...).
>
> This guy went on about how he'd always wanted to own a "brand", and stated
> that all it took was a couple of pubs, a brewery, and some nice bottles.
> There was a comment something like "What's in the bottle doesn't matter,
> just what it looks like", and some stuff about outsourcing most of the
> production to Scottish and Newcastle or similar.
>
> I quite like some of the beer, and I've never been to one of the pubs, but
> my attitude them has never quite been the same since I read the article...
> - End forwarded message -
>
>
> That makes me feel dirty - even though I love the ale. Anybody know
> anything else?

Go check out http://www.stpetersbrewery.co.uk/ for the full story. I don't 
disapprove of what they have done.

Ivor.





st peter's ale

2002-11-13 Thread Simon Wistow
On another mailing list (I was thinking of you! honest! they meant
nothing) where we were having the perpetual "What pub shallw e go to
next" discussion I mentioned The Jerusalem Tavern and said that I liked
St Peter's ale. I got this reply

- Begin forwarded message -
> That St. Peter's the branding exercise, right? Boy Jackson has the odd
> tale to tell...

Hmm. I read a depressing article in a weekend supplement a while back. St.
Peters was created by the former head of Interbrand (they came up with the
PriceWaterhouseCoopers - phew, that took some getting out - concept, among
other pieces of genius...).

This guy went on about how he'd always wanted to own a "brand", and stated
that all it took was a couple of pubs, a brewery, and some nice bottles.
There was a comment something like "What's in the bottle doesn't matter,
just what it looks like", and some stuff about outsourcing most of the
production to Scottish and Newcastle or similar.

I quite like some of the beer, and I've never been to one of the pubs, but
my attitude them has never quite been the same since I read the article...
- End forwarded message -


That makes me feel dirty - even though I love the ale. Anybody know
anything else?

Simon