Apache::RequestNotes and sharing information

2001-10-19 Thread Chui G. Tey



I am using 
RequestNotes with PerlAccessHandler and a PerlHandler.

When the browser 
connects for the first time,
The 
PerlAccessHandler sets a session_based cookie, using TIEHASH
$r-pnotes("COOKIES")-{'SESSION_ID'} = 
$session{_session_id};

And the PerlHandler 
retrieves the session_id using
$session_id = $r-pnotes("COOKIES")-{'SESSION_ID'} 


To my surprise, in the PerlHandler$r-pnotes("COOKIES")-{'SESSION_ID'} has not been 
set.
Is there any way to 
share data between different handlers?

Chui Tey
Software Engineer
Advanced Data Integration
PO Box 660
Spring Hill QLD 4004
AUSTRALIA
Ph:07 3250 5300
Fax: 07 3250 5399
[mailto: [EMAIL PROTECTED]]




Re: Apache::RequestNotes and sharing information

2001-10-19 Thread Gerald Richter

The PerlAccessHandler sets a session_based cookie, using TIEHASH
$r-pnotes(COOKIES)-{'SESSION_ID'} = $session{_session_id};

Unless you have already stored a hash ref in pnotes with key COOKIES, you
must write:

$r-pnotes(COOKIES, {'SESSION_ID' = $session{_session_id}}) ;

this stores a new hash ref in the pnotes table. Then it should work

Gerald


-
Gerald Richterecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:   Tulpenstrasse 5 D-55276 Dienheim b. Mainz
E-Mail: [EMAIL PROTECTED] Voice:+49 6133 925131
WWW:http://www.ecos.de  Fax:  +49 6133 925152
-





Re: Excellent article on Apache/mod_perl at eToys

2001-10-19 Thread Greg Cope

Andrew Ho wrote:
 
 Hello,
 
 I checked the list archives and it didn't look like this had been posted yet.
 For those of you who haven't seen it yet... a great read on perl.com about
 the Apache/mod_perl setup at eToys, co-authored by our own mod_perl
 regular contributer Perrin Harkins.
 
 http://www.perl.com/pub/a/2001/10/17/etoys.html
 

Yup, this is an excellent read.  Thanks Perrin.

Greg



RE: Problem using mod_perl-1.26 with perl 5.6.1 and XML::Parser

2001-10-19 Thread Matt Sergeant

 -Original Message-
 From: Matthew H. Gerlach [mailto:[EMAIL PROTECTED]]
 
 Now that I had something reproducible, I continued.  I rebuilt using
 Apache 1.3.22 just like above, and everything continued to work.  I
 upgraded to XML::Parser-2.30, and things continued to work.  
 It was only
 when I went from perl 5.005_3 to 5.6.1 did my module break.  As I said
 above I tried a statically linked apache.  I also tried 
 building Apache
 1.3.22 as above with perl 5.6.1 and my code failed with both
 XML::Parser-2.29 and XML::Parser-2.30.  Whatever way I tried 
 using perl
 5.6.1 I had my nasty problem.
 
 When configuring Apache 1.3.22 I noticed it said it was using the
 system's libexpat which was installed with RH.  XML::Parser-2.29 uses
 its own copy of expat, but XML::Parser-2.30 uses the system libexpat.
 As I said with perl 5.005_3 I was able to use either version of
 XML::Parser.

From what I can tell from the Apache 1.3.22 build, here's how to get it
stable:

1. Install libexpat.
2. Install perl
3. Install XML::Parser 2.30
4. Install mod_perl and Apache, telling mod_perl to build Apache for you.
  ** Do not use APXS to build mod_perl **

The recipe in the AxKit INSTALL file seems to work best for people doing XML
stuff inside mod_perl:

 $ perl Makefile.PL \
  EVERYTHING=1 \
  USE_APACI=1 \
  DYNAMIC=1 \
  APACHE_PREFIX=/opt/apache \
  APACHE_SRC=../apache_1.3.22/src \
  DO_HTTPD=1 \
  APACI_ARGS=--enable-module=so --enable-shared=info
  --enable-shared=proxy --enable-shared=rewrite
  --enable-shared=log_agent
 $ make
 $ su
 $ make install

However, that also builds Apache with --disable-rule=expat, so it might
kinda defeat your purpose :-) If you *really* need the expat in Apache, I
think you can add in there --enable-rule=expat, but I haven't tried it.

If all that fails, switch to XML::LibXML or XML::SAX::PurePerl (actually,
think about doing that anyway :-)

Matt.

_
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.



rookie's question regarding dynamic html pages

2001-10-19 Thread Xavier Merlin

Hello,

I  am a rookie in this, so I am probably asking trivial things here.

My current environment is: 

Windows NT 4.0 SP 5,
Apache 1.3.9
Active state perl 522 

I have written a perl monitor which writes simple static html pages having 
the format

html
pre
 multiple ascii lines (output of the various monitors)
/pre
/html

I would like to make those pages dynamic

Maybe  modperl can help. What do I need ? Any experiences, example(s) ?

Should I need the following  described in 
http://theoryx5.uwinnipeg.ca/pub/other/perl-win32-bin-0.7.readme ?

Your help is greatly appreciated

Tnx

Xavier



Re: Excellent article on Apache/mod_perl at eToys

2001-10-19 Thread Gunther Birznieks

Yeah we really enjoyed it over here. I think it's really excellent to get 
great advocacy articles about Perl and surrounding products (mod_perl, TT, 
etc) powering real businesses with real high powered needs out there like 
this one.

:)

At 04:40 PM 10/19/2001, Greg Cope wrote:
Andrew Ho wrote:
 
  Hello,
 
  I checked the list archives and it didn't look like this had been 
 posted yet.
  For those of you who haven't seen it yet... a great read on perl.com about
  the Apache/mod_perl setup at eToys, co-authored by our own mod_perl
  regular contributer Perrin Harkins.
 
  http://www.perl.com/pub/a/2001/10/17/etoys.html
 

Yup, this is an excellent read.  Thanks Perrin.

Greg

__
Gunther Birznieks ([EMAIL PROTECTED])
eXtropia - The Open Web Technology Company
http://www.eXtropia.com/




Re: rookie's question regarding dynamic html pages

2001-10-19 Thread Ged Haywood

EaOn 19 Oct 2001, Xavier Merlin wrote:

 I would like to make those pages dynamic
 
 Maybe  modperl can help. What do I need ?

The Eagle Book:

  Writing Apache Modules with Perl and C, ISBN 1-56592-567-X,
  by Lincoln Stein and Doug MacEachern.

  It is available from O'Reilley (www.oreilly.com) and of course
  from Jubilee Office Supplies (www.jubileegroup.co.uk).

Stas Bekman's mod_perl Guide:

  http://perl.apache.org/guide/


Have fun!

73,
Ged.




RE: Excellent article on Apache/mod_perl at eToys

2001-10-19 Thread Geoffrey Young



 -Original Message-
 From: Gunther Birznieks [mailto:[EMAIL PROTECTED]]
 Sent: Friday, October 19, 2001 6:47 AM
 To: mod_perl List
 Cc: Template Toolkit List
 Subject: Re: Excellent article on Apache/mod_perl at eToys
 
 
 Yeah we really enjoyed it over here. I think it's really 
 excellent to get 
 great advocacy articles about Perl and surrounding products 
 (mod_perl, TT, 
 etc) powering real businesses with real high powered needs 
 out there like 
 this one.
 
 :)

I particularly like the part about sending a router up in flames.  That came
across a little better at ApacheCon - maybe the article needs some flaming
icon or something

;)

nice work Perrin (as usual)

--Geoff



Re: Excellent article on Apache/mod_perl at eToys

2001-10-19 Thread Perrin Harkins

Thanks to all for the kind words.  This article actually went up a little
bit before it was supposed to, and there should be a revision going up soon
with some grammatical fixes and a set of graphics to illustrate parts of it.
I'll post a follow-up when that happens in case anyone wants to go and look
at the pretty pictures.

While we're on the subject, thanks to everyone who contributed to the many
open source projects that we used.  We couldn't have done it without you.

- Perrin




Re: [Templates] Re: Excellent article on Apache/mod_perl at eToys

2001-10-19 Thread Drew Taylor

What I found most interesting was the detail of the extensive caching which 
was implemented to survive the seasonal rush. I look forward to working on 
a project one day that is big enough to warrant such a system. All in all, 
a most excellent and informative read.

Thanks again for everything you've personally done for the community! I 
look forward to seeing those graphics. :-)

At 09:49 AM 10/19/01 -0400, Perrin Harkins wrote:
Thanks to all for the kind words.  This article actually went up a little
bit before it was supposed to, and there should be a revision going up soon
with some grammatical fixes and a set of graphics to illustrate parts of it.
I'll post a follow-up when that happens in case anyone wants to go and look
at the pretty pictures.

While we're on the subject, thanks to everyone who contributed to the many
open source projects that we used.  We couldn't have done it without you.

Drew Taylor JA[P|m_p|SQL]H
http://www.drewtaylor.com/  Just Another Perl|mod_perl|SQL Hacker
mailto:[EMAIL PROTECTED]  *** God bless America! ***
ICQ: 135298242







RE: Excellent article on Apache/mod_perl at eToys

2001-10-19 Thread Clinton Gormley

 
 Thanks to all for the kind words.  This article actually went 
 up a little
 bit before it was supposed to, and there should be a revision 
 going up soon
 with some grammatical fixes and a set of graphics to 
 illustrate parts of it.
 I'll post a follow-up when that happens in case anyone wants 
 to go and look
 at the pretty pictures.

Hi Perrin

What I'd love to see is the avg spec and numbers of machines in each
section.  So how many proxy, mod_perl and search servers were required to
give the phenomenal performance you managed to achieve.

thanks

Clinton Gormley



RE: [Templates] Re: Excellent article on Apache/mod_perl at eToys

2001-10-19 Thread Joe Breeden

I work in a predominately M$ shop. AS a matter of fact, I am one of only two
Perl/mod_perl programmers in a development department with 25 other
programmers. Sometimes it feels like we are working in a vacuum. This list
and articles like the eToys article along with the overwhelmingly superior
performance of mod_perl/Apache vs. either M$ IIS/ASP or M$ IIS/ColdFusion
are what make, at least for me, doing what I do for a living where I do it
possible. If it weren't for our success with mod_perl/Apache I really
believe that this project would have been converted to ColdFusion a long
time ago. Anecdotal evidence like the eToys article only add to the growing
body of evidence that what we do with mod_perl is really the best of the
available alternatives. 

Not only doe Perrin deserve a pat on the back for his article, but everyone
who promotes the use of these technologies should feel good about what
themselves.


--Joe Breeden
---
If it compiles - Ship It!

 -Original Message-
 From: Drew Taylor [mailto:[EMAIL PROTECTED]]
 Sent: Friday, October 19, 2001 8:59 AM
 To: Perrin Harkins; mod_perl List
 Cc: Template Toolkit List
 Subject: Re: [Templates] Re: Excellent article on Apache/mod_perl at
 eToys
 
 
 What I found most interesting was the detail of the extensive 
 caching which 
 was implemented to survive the seasonal rush. I look forward 
 to working on 
 a project one day that is big enough to warrant such a 
 system. All in all, 
 a most excellent and informative read.
 
 Thanks again for everything you've personally done for the 
 community! I 
 look forward to seeing those graphics. :-)
 
 At 09:49 AM 10/19/01 -0400, Perrin Harkins wrote:
 Thanks to all for the kind words.  This article actually 
 went up a little
 bit before it was supposed to, and there should be a 
 revision going up soon
 with some grammatical fixes and a set of graphics to 
 illustrate parts of it.
 I'll post a follow-up when that happens in case anyone wants 
 to go and look
 at the pretty pictures.
 
 While we're on the subject, thanks to everyone who 
 contributed to the many
 open source projects that we used.  We couldn't have done it 
 without you.
 
 Drew Taylor JA[P|m_p|SQL]H
 http://www.drewtaylor.com/  Just Another Perl|mod_perl|SQL Hacker
 mailto:[EMAIL PROTECTED]  *** God bless America! ***
 ICQ: 135298242
 
 
 
 



Re: Excellent article on Apache/mod_perl at eToys

2001-10-19 Thread Perrin Harkins

 What I'd love to see is the avg spec and numbers of machines in each
 section.  So how many proxy, mod_perl and search servers were required to
 give the phenomenal performance you managed to achieve.

Well, this was a long time ago (I wrote the article over a year ago), and I
don't remember exactly.  The proxy machines were pretty basic, the search
servers were heavy on CPU power, and the mod_perl servers were heavy on RAM.
There were a lot of machines in the cluster, but I don't remember exactly
how many and it changed over time.  There were dozens of mod_perl servers
when the cluster was at its biggest.  Most of them were idle for the
majority of the time, but they were all needed for the occasional peak load.

I remember at one point I was feeling embarrassed about the number of
machines and I told one of our sysadmins that it might have been a better
strategy to get a big Sun box or two instead.  He replied that a Sun box
with equivalent power would have cost about 10 times as much as what we paid
for our rackmounted Intel machines.  After that, I didn't worry about it too
much.

- Perrin




Selectively writing to the access log

2001-10-19 Thread Rodney Broom

I'm wanting to look at the request and optionally change what gets written to the 
access log. However, I only see methods for writing to the error log. I think I need 
to do this inside the request because I'm piping things with TransferLog and don't 
want to interupt that. But I don't mind another aproach.

---
Rodney Broom





Re: Excellent article on Apache/mod_perl at eToys

2001-10-19 Thread Tom Servo

If memory serves, I think we had something like 20-30 proxy servers and I
think, at the end, we had w21 through w112 for app servers, so something
like 92 app servers.   I don't remember how many search boxes though.

Thanks for the article Perrin, I didn't know half of what you, Ollie,
Chris, Adam, Doug, and others had put together.   And secondly, thanks for
teaching me all the stuff you did, I feel pretty lucky to have worked with
you there.


Brian Nilsen
[EMAIL PROTECTED]

On Fri, 19 Oct 2001, Perrin Harkins wrote:

  What I'd love to see is the avg spec and numbers of machines in each
  section.  So how many proxy, mod_perl and search servers were required to
  give the phenomenal performance you managed to achieve.
 
 Well, this was a long time ago (I wrote the article over a year ago), and I
 don't remember exactly.  The proxy machines were pretty basic, the search
 servers were heavy on CPU power, and the mod_perl servers were heavy on RAM.
 There were a lot of machines in the cluster, but I don't remember exactly
 how many and it changed over time.  There were dozens of mod_perl servers
 when the cluster was at its biggest.  Most of them were idle for the
 majority of the time, but they were all needed for the occasional peak load.
 
 I remember at one point I was feeling embarrassed about the number of
 machines and I told one of our sysadmins that it might have been a better
 strategy to get a big Sun box or two instead.  He replied that a Sun box
 with equivalent power would have cost about 10 times as much as what we paid
 for our rackmounted Intel machines.  After that, I didn't worry about it too
 much.
 
 - Perrin
 
 




Re: Selectively writing to the access log

2001-10-19 Thread Rob Nagler

 I only see methods for writing to the error log. 

I don't think you can change the access log format, but you can 
modify the values.  For example, you can set $c-user and $c-remote_ip.

Rob



Location, SetHandler and Aliases in httpd.conf

2001-10-19 Thread Peter Beardsley



Hi, sorry if this is slightly OT but I need some 
help getting my apache config straightened out.

I want to set up Apache so that requests to the 
document root are handled by mod_perl, but requests to a special images 
directory are not handled by mod_perl. Currently I have it set up like 
so:

--
Alias /art 
/usr/local/apache/htdocs/art

Location / SetHandler 
perl-script PerlHandler 
MyModule/Location

--

Apparently Location takes precidence over Alias 
becauseit's ignoring my Alias and going to my perl handler.

Does anyone know a way to make it do what I'm 
trying to do?


Re: Excellent article on Apache/mod_perl at eToys

2001-10-19 Thread Keith G. Murphy

Andrew Ho wrote:
 
 Hello,
 
 I checked the list archives and it didn't look like this had been posted yet.
 For those of you who haven't seen it yet... a great read on perl.com about
 the Apache/mod_perl setup at eToys, co-authored by our own mod_perl
 regular contributer Perrin Harkins.
 
 http://www.perl.com/pub/a/2001/10/17/etoys.html
 
That's so awesome, the single best piece of technical writing on the web
I can remember in a long time.  Thanks for sharing.

By the way, I noticed he documented still another gotcha due to a sneaky
closure.  Does anyone know off-hand whether the Perl 6 folks plan to
change the closure syntax so they don't sneak into your code this way?

I wonder how many mod_perl authors have never been burned by one?



[OT] Re: Excellent article on Apache/mod_perl at eToys

2001-10-19 Thread Thomas Klausner

Hi!

On Fri, Oct 19, 2001 at 09:59:18AM -0400, Drew Taylor wrote:
 What I found most interesting was the detail of the extensive caching which 
 was implemented to survive the seasonal rush.
Wasn't this seasonal rush at least partly caused by the so-called toywar
(www.toywar.com) between eToys.com (the online retailer) and etoy.com
(the art group)?

As far as I remember this incident, eToys.com sued etoy.com (who were
holding this domain since 1994) because of trademark delusion etc., which
caused one of the first distrubuted DOS attacks against etoys.com.

see:
http://rtmark.com/etoymain.html


-- 
D_OMM
O_xyderkes
M_echanenhttp://domm.zsi.at
M_asteuei



Re: [OT] Re: Excellent article on Apache/mod_perl at eToys

2001-10-19 Thread Perrin Harkins

 Wasn't this seasonal rush at least partly caused by the so-called toywar
 (www.toywar.com) between eToys.com (the online retailer) and etoy.com
 (the art group)?

There were a lot of DoS attacks (and some even uglier, nastier ones) in 1999
as a result of that.  Most of that was dealt with through standard access
control stuff, plus the throttling code that was mentioned in the article.

The 2000 rush, which we built this new system for, was real customer
traffic, although there's always some joker with a bot trying to buy all the
PlayStation 2 units.

- Perrin




Re: Selectively writing to the access log

2001-10-19 Thread Rodney Broom

From: Rob Nagler [EMAIL PROTECTED]

 I don't think you can change the access log format, but you can 
 modify the values.  For example, you can set $c-user and $c-remote_ip.

Thanks Rob, this is helpful and it works. The value I'm wanting to change is in 
r-the_request, but passing a value to that method yeilds a usage message:

  Usage: Apache::the_request(r)

This routine returns a string, so I assumed it would take a string. I've tried passing 
other things always getting the same message. I've glanced at mod_log_conf.c, and some 
core code, but I don't see what I need to pass.

---
Rodney Broom






RE: Selectively writing to the access log

2001-10-19 Thread Geoffrey Young



 -Original Message-
 From: Rodney Broom [mailto:[EMAIL PROTECTED]]
 Sent: Friday, October 19, 2001 3:14 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Selectively writing to the access log
 
 
 From: Rob Nagler [EMAIL PROTECTED]
 
  I don't think you can change the access log format, but you can 
  modify the values.  For example, you can set $c-user and 
 $c-remote_ip.
 
 Thanks Rob, this is helpful and it works. The value I'm 
 wanting to change is in r-the_request, but passing a value 
 to that method yeilds a usage message:
 
   Usage: Apache::the_request(r)
 
 This routine returns a string, so I assumed it would take a 
 string. I've tried passing other things always getting the 
 same message. I've glanced at mod_log_conf.c, and some core 
 code, but I don't see what I need to pass.

are you on an old version of mod_perl?  from Changes:

=item 1.23 - April 20, 2000
...
$r-the_request can now be modified

HTH

--Geoff



Re: Selectively writing to the access log

2001-10-19 Thread Rodney Broom

From: Geoffrey Young [EMAIL PROTECTED]

 are you on an old version of mod_perl?  from Changes:
 $r-the_request can now be modified

Good catch, yes I was using 1.19. I've moved a machine with 1.26 and 
r-the_request($string) no longer fails. However, with 1.26 none of changes I'm making 
to the request object are showing up in the access log. I was able to overload certain 
fields with 1.19.


---
Rodney Broom






Re: Selectively writing to the access log

2001-10-19 Thread Rodney Broom

- Original Message - 
From: Mark Doyle [EMAIL PROTECTED]


 I missed your original post, but maybe this will help.
 
 What about creating a new log using CustomLog and tying it to an
 environment variable and only setting this in the requests you want
 to log? I do this to log subscriber activity in a separate log
 (still goes to the main access_log with all non-subscriber activity
 as well, but it doesn't really matter as the separate log file is
 much smaller and only has the events I need to process).


My ultimate goal is this:
I have a silly redirector script that acts as a logging hook for folks clicking their 
way out of the site. The hit a link like redir.cgi?dest=abc. My client has a web 
report that displays by document, meaning that all of these redirects would show up in 
the report lumped together as though they were equivilant. What I want is to change 
the access_log entry for sake of that report, so I'd essentially have mappings like:

  redir.cgi?dest=abc  = redir_abc.html
  redir.cgi?dest=jack = redir_jack.html

This will break out the individual redirection requests in a way that makes sence in a 
human-readable report.

Make sence?


---
Rodney Broom






Re: Selectively writing to the access log

2001-10-19 Thread Rob Nagler

   Usage: Apache::the_request(r)

This means the sub Apache::the_request takes a single parameter,
i.e. you can't modify the_request.

You can modify the method and uri.  You can't modify the protocol 
(HTTP/1.0).  If you change method or uri, it doesn't change the_request.
You can change your LogFormat to get these values--see
http://httpd.apache.org/docs/mod/mod_log_config.html

Rob



Re: Selectively writing to the access log

2001-10-19 Thread Mark Doyle

How about adding a custom header with the format you want
and then logging that with a custom log format?

Cheers,
Mark

On Friday, October 19, 2001, at 04:09 PM, Rodney Broom wrote:

 My ultimate goal is this:
 I have a silly redirector script that acts as a logging hook for folks 
 clicking their way out of the site. The hit a link like 
 redir.cgi?dest=abc. My client has a web report that displays by 
 document, meaning that all of these redirects would show up in the 
 report lumped together as though they were equivilant. What I want is 
 to change the access_log entry for sake of that report, so I'd 
 essentially have mappings like:

   redir.cgi?dest=abc  = redir_abc.html
   redir.cgi?dest=jack = redir_jack.html

 This will break out the individual redirection requests in a way that 
 makes sence in a human-readable report.

 Make sence?


 ---
 Rodney Broom






Re: Selectively writing to the access log

2001-10-19 Thread Rodney Broom

From: Mark Doyle [EMAIL PROTECTED]

 How about adding a custom header with the format you want
 and then logging that with a custom log format?

I think I've found an acceptable method. I've got a log handler like this:

my $req = $r-the_request;
if ($r-uri =~ /$something_interesting/) {
$req =~ s/$stuff/$other_stuff/;
}

$r-subprocess_env('THE_REQUEST', $req);


Then I'm using a custom log format like this:

  LogFormat %h %l %u %t \%{THE_REQUEST}e\ %s %b \%{User-Agent}i\ req_overload


---
Rodney Broom






Re: Problem using mod_perl-1.26 with perl 5.6.1 and XML::Parser

2001-10-19 Thread Matthew H. Gerlach


Just to follow up.  I took your advice on building building modperl.  My actual
command was as follows:


perl Makefile.PL \
EVERYTHING=1 \
USE_APACI=1 \
APACHE_PREFIX=/lsurf/wohg \
APACHE_SRC=../$APACHE/src \
DO_HTTP=1 \
APACI_ARGS=--enable-rule=expat --enable-module=so --enable-shared=info \
--enable-shared=proxy --enable-shared=rewrite



I first tried this with perl 5.005_3 with no problems.  I then upgraded to perl
5.6.1, reinstalled the XML::Parser 2.30, and rebuild modperl/apache.  The nasty
bug showed back up.  At this point it still looks like I'm SOL using
XML::Parser with perl 5.6.1 under modper.

I did  download and install XML::LibXML and started playing with it.  I'm
actually using XML::Parser via XML::Simple to put short XML messages into
handy 'data structures'.   Maybe I should make an XML::LibXML::Simple :)

Thanks for the help,

Matthew



Matt Sergeant wrote:

  -Original Message-
  From: Matthew H. Gerlach [mailto:[EMAIL PROTECTED]]
 
  Now that I had something reproducible, I continued.  I rebuilt using
  Apache 1.3.22 just like above, and everything continued to work.  I
  upgraded to XML::Parser-2.30, and things continued to work.
  It was only
  when I went from perl 5.005_3 to 5.6.1 did my module break.  As I said
  above I tried a statically linked apache.  I also tried
  building Apache
  1.3.22 as above with perl 5.6.1 and my code failed with both
  XML::Parser-2.29 and XML::Parser-2.30.  Whatever way I tried
  using perl
  5.6.1 I had my nasty problem.
 
  When configuring Apache 1.3.22 I noticed it said it was using the
  system's libexpat which was installed with RH.  XML::Parser-2.29 uses
  its own copy of expat, but XML::Parser-2.30 uses the system libexpat.
  As I said with perl 5.005_3 I was able to use either version of
  XML::Parser.

 From what I can tell from the Apache 1.3.22 build, here's how to get it
 stable:

 1. Install libexpat.
 2. Install perl
 3. Install XML::Parser 2.30
 4. Install mod_perl and Apache, telling mod_perl to build Apache for you.
   ** Do not use APXS to build mod_perl **

 The recipe in the AxKit INSTALL file seems to work best for people doing XML
 stuff inside mod_perl:

  $ perl Makefile.PL \
   EVERYTHING=1 \
   USE_APACI=1 \
   DYNAMIC=1 \
   APACHE_PREFIX=/opt/apache \
   APACHE_SRC=../apache_1.3.22/src \
   DO_HTTPD=1 \
   APACI_ARGS=--enable-module=so --enable-shared=info
   --enable-shared=proxy --enable-shared=rewrite
   --enable-shared=log_agent
  $ make
  $ su
  $ make install

 However, that also builds Apache with --disable-rule=expat, so it might
 kinda defeat your purpose :-) If you *really* need the expat in Apache, I
 think you can add in there --enable-rule=expat, but I haven't tried it.

 If all that fails, switch to XML::LibXML or XML::SAX::PurePerl (actually,
 think about doing that anyway :-)

 Matt.

 _
 This message has been checked for all known viruses by Star Internet
 delivered through the MessageLabs Virus Scanning Service. For further
 information visit http://www.star.net.uk/stats.asp or alternatively call
 Star Internet for details on the Virus Scanning Service.




stacked handlers return vals

2001-10-19 Thread Mark Maunder

Hi,

If I'm using stacked handlers, what should I return if I dont want the
next handler in line to run because I've returned all required content
to the client? (the eagle book says anything other than OK, DECLINED or
DONE, but what's the appropriate return val that wont cause the client
to think an error occured?)

tnx!






Re: [OT] Excellent article on Apache/mod_perl at eToys

2001-10-19 Thread Jeremy Howard

 By the way, I noticed he documented still another gotcha due to a sneaky
 closure.  Does anyone know off-hand whether the Perl 6 folks plan to
 change the closure syntax so they don't sneak into your code this way?

Closures, references, et al are being thoroughly revised, such that there
will be far fewer gotchas. However, these kinds of memory leaks will be less
of an issue anyway because Perl 6 will be garbage collected. Also, proper
exception handling will be built into the language.

PS: I haven't seen many of the regulars here on the Perl 6 lists. There's
both language design and internals streams currently happening, so
everyone's interests and skills should be catered for. Please have a look at
http://dev.perl.org and consider getting involved. It's interesting work and
there's a similarly positive and intellectual spirit on the P6 lists to what
we experience here.





rookie question

2001-10-19 Thread Xavier Merlin

Hello,

I am completely new to the issue. My question is probably very 
straightforward but maybe you can help me out.

I have made a monitor in perl which periodically overwrites static pages 
containing the output of various commands.

The html pages are consisting of:

html
pre
multiple ascii text lines
/pre
/html

How can I easily make those pages dynamic ? (without the user doing a 
reload/refresh)

Kind regards,

Xavier Merlin



@INC

2001-10-19 Thread Plows, Sean (London)

How can I set this as my cgi's can't locate my libs?

 Regards,
 
 Sean Plows



Re: mod_perl-1.2.6 for Cygwin 1.x (using apache_1.3.22, perl-5.6.1)

2001-10-19 Thread Charles Wilson

Stipe Tolj wrote:


What is the problem with ld2?

 
 I'm using a patched version of ld which supports --auto-import.


the official cygwin ld now supports --auto-import (and has since August 02.)

--Chuck





Re: Problem using mod_perl-1.26 with perl 5.6.1 and XML::Parser

2001-10-19 Thread clayton cottingham

Matthew H. Gerlach wrote:
 
 Just to follow up.  I took your advice on building building modperl.  My actual
 command was as follows:
 
 perl Makefile.PL \
 EVERYTHING=1 \
 USE_APACI=1 \
 APACHE_PREFIX=/lsurf/wohg \
 APACHE_SRC=../$APACHE/src \
 DO_HTTP=1 \
 APACI_ARGS=--enable-rule=expat --enable-module=so --enable-shared=info \
 --enable-shared=proxy --enable-shared=rewrite
 
 I first tried this with perl 5.005_3 with no problems.  I then upgraded to perl
 5.6.1, reinstalled the XML::Parser 2.30, and rebuild modperl/apache.  The nasty
 bug showed back up.  At this point it still looks like I'm SOL using
 XML::Parser with perl 5.6.1 under modper.
 
 I did  download and install XML::LibXML and started playing with it.  I'm
 actually using XML::Parser via XML::Simple to put short XML messages into
 handy 'data structures'.   Maybe I should make an XML::LibXML::Simple :)
 


i would say that XML::LibXML is the most stable
modules ive used
everything else perl has failed for the X3D parsing tool i made:
http://drfrog.fdns.net/perl/parsex3d.pl

this will have a much nicer home at web3d.org at some point soon
they found a bug in it on freebsd timezone related iirc



cvs commit: modperl-2.0/ModPerl-Registry/t/conf extra.conf.in

2001-10-19 Thread stas

stas01/10/18 23:46:25

  Modified:ModPerl-Registry/t/conf extra.conf.in
  Log:
  - prepare the configuration for a set of /same_interp aliases and registry
  configurations
  - some slight reorg of the conf file
  
  Revision  ChangesPath
  1.2   +73 -15modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in
  
  Index: extra.conf.in
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- extra.conf.in 2001/10/09 12:47:38 1.1
  +++ extra.conf.in 2001/10/19 06:46:25 1.2
  @@ -4,29 +4,31 @@
   PerlSwitches -T
   
   PerlSwitches -Mlib=@ServerRoot@/../lib
  +PerlSwitches -Mlib=@ServerRoot@/../../Apache-Test/lib
   PerlSwitches -Mlib=@ServerRoot@/../../lib
   PerlSwitches -Mlib=@ServerRoot@/../../blib/lib
   PerlSwitches -Mlib=@ServerRoot@/../../blib/arch
   
  -Alias /registry/ @ServerRoot@/cgi-bin/
  -Alias /registry_ng/  @ServerRoot@/cgi-bin/
  -Alias /registry_bb/  @ServerRoot@/cgi-bin/
  -Alias /registry_oo_conf/ @ServerRoot@/cgi-bin/
  -Alias /perlrun/  @ServerRoot@/cgi-bin/
  -
  -#PerlModule TestDebugMy
  -
  -PerlSetVar ModPerl::RegistryCooker::DEBUG 0
  -
  -### DEVMODE: Remove in production ###
  + DEVMODE: Remove in production ###
   PerlModule Apache::Reload
   PerlInitHandler Apache::Reload
   PerlSetVar ReloadAll Off
   PerlSetVar ReloadModules ModPerl::*
   
  +PerlSetVar ModPerl::RegistryCooker::DEBUG 2
  +
   PerlModule ModPerl::RegistryCooker
   PerlModule ModPerl::Util
   
  +#
  +### Normal registry setup ###
  +#
  +Alias /registry/ @ServerRoot@/cgi-bin/
  +Alias /registry_ng/  @ServerRoot@/cgi-bin/
  +Alias /registry_bb/  @ServerRoot@/cgi-bin/
  +Alias /registry_oo_conf/ @ServerRoot@/cgi-bin/
  +Alias /perlrun/  @ServerRoot@/cgi-bin/
  +
   PerlModule ModPerl::RegistryNG
   Location /registry_ng
   PerlOptions +GlobalRequest
  @@ -45,6 +47,24 @@
   PerlOptions +ParseHeaders
   /Location
   
  +PerlModule ModPerl::Registry
  +Location /registry
  +  #  PerlOptions +GlobalRequest
  +SetHandler perl-script
  +Options +ExecCGI
  +PerlResponseHandler ModPerl::Registry
  +PerlOptions +ParseHeaders
  +/Location
  +
  +# META: dumps core on OO handlers
  +Location /registry_oo_conf
  +PerlOptions +GlobalRequest
  +SetHandler perl-script
  +Options +ExecCGI
  +PerlResponseHandler ModPerl::Registry-handler
  +PerlOptions +ParseHeaders
  +/Location
  +
   PerlModule ModPerl::PerlRun
   Location /perlrun
   PerlOptions +GlobalRequest
  @@ -54,21 +74,59 @@
   PerlOptions +ParseHeaders
   /Location
   
  -PerlModule ModPerl::Registry
  -Location /registry
  +###
  +### Same interpreter registry setup ###
  +###
  +
  +Alias /same_interp/registry/ @ServerRoot@/cgi-bin/
  +Alias /same_interp/registry_ng/  @ServerRoot@/cgi-bin/
  +Alias /same_interp/registry_bb/  @ServerRoot@/cgi-bin/
  +Alias /same_interp/registry_oo_conf/ @ServerRoot@/cgi-bin/
  +Alias /same_interp/perlrun/  @ServerRoot@/cgi-bin/
  +
  +PerlModule Apache::TestHandler
  +Location /same_interp/registry_ng
  +PerlOptions +GlobalRequest
  +SetHandler perl-script
  +Options +ExecCGI
  +PerlFixupHandler Apache::TestHandler::same_interp_fixup
  +PerlResponseHandler ModPerl::RegistryNG
  +PerlOptions +ParseHeaders
  +/Location
  +
  +Location /same_interp/registry_bb
   PerlOptions +GlobalRequest
   SetHandler perl-script
   Options +ExecCGI
  +PerlFixupHandler Apache::TestHandler::same_interp_fixup
  +PerlResponseHandler ModPerl::RegistryBB
  +PerlOptions +ParseHeaders
  +/Location
  +
  +Location /same_interp/registry
  +  #  PerlOptions +GlobalRequest
  +SetHandler perl-script
  +Options +ExecCGI
  +PerlFixupHandler Apache::TestHandler::same_interp_fixup
   PerlResponseHandler ModPerl::Registry
   PerlOptions +ParseHeaders
   /Location
   
  -# META: dumps core on OO handlers
  -Location /registry_oo_conf
  +Location /same_interp/registry_oo_conf
   PerlOptions +GlobalRequest
   SetHandler perl-script
   Options +ExecCGI
  +PerlFixupHandler Apache::TestHandler::same_interp_fixup
   PerlResponseHandler ModPerl::Registry-handler
  +PerlOptions +ParseHeaders
  +/Location
  +
  +Location /same_interp/perlrun
  +PerlOptions +GlobalRequest
  +SetHandler perl-script
  +Options +ExecCGI
  +PerlFixupHandler Apache::TestHandler::same_interp_fixup
  +PerlResponseHandler ModPerl::PerlRun
   PerlOptions +ParseHeaders
   /Location
   
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_handler.h modperl_perl_global.h modperl_types.h

2001-10-19 Thread dougm

dougm   01/10/19 09:40:45

  Modified:src/modules/perl modperl_handler.h modperl_perl_global.h
modperl_types.h
  Log:
  get rid of hpux warnings:
  Dangling comma not allowed by ANSI standard, ignored.
  
  Revision  ChangesPath
  1.8   +1 -1  modperl-2.0/src/modules/perl/modperl_handler.h
  
  Index: modperl_handler.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_handler.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- modperl_handler.h 2001/04/19 17:57:15 1.7
  +++ modperl_handler.h 2001/10/19 16:40:44 1.8
  @@ -4,7 +4,7 @@
   typedef enum {
   MP_HANDLER_ACTION_GET,
   MP_HANDLER_ACTION_PUSH,
  -MP_HANDLER_ACTION_SET,
  +MP_HANDLER_ACTION_SET
   } modperl_handler_action_e;
   
   #define modperl_handler_array_new(p) \
  
  
  
  1.10  +1 -1  modperl-2.0/src/modules/perl/modperl_perl_global.h
  
  Index: modperl_perl_global.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_global.h,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- modperl_perl_global.h 2001/10/13 19:02:03 1.9
  +++ modperl_perl_global.h 2001/10/19 16:40:44 1.10
  @@ -9,7 +9,7 @@
   } modperl_modglobal_key_t;
   
   typedef enum {
  -MP_MODGLOBAL_END,
  +MP_MODGLOBAL_END
   } modperl_modglobal_key_e;
   
   typedef struct {
  
  
  
  1.52  +2 -2  modperl-2.0/src/modules/perl/modperl_types.h
  
  Index: modperl_types.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_types.h,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- modperl_types.h   2001/09/28 19:51:40 1.51
  +++ modperl_types.h   2001/10/19 16:40:44 1.52
  @@ -107,7 +107,7 @@
   MP_INTERP_SCOPE_HANDLER,
   MP_INTERP_SCOPE_SUBREQUEST,
   MP_INTERP_SCOPE_REQUEST,
  -MP_INTERP_SCOPE_CONNECTION,
  +MP_INTERP_SCOPE_CONNECTION
   } modperl_interp_scope_e;
   
   typedef struct {
  @@ -176,7 +176,7 @@
   
   typedef enum {
   MP_INPUT_FILTER_MODE,
  -MP_OUTPUT_FILTER_MODE,
  +MP_OUTPUT_FILTER_MODE
   } modperl_filter_mode_e;
   
   typedef struct {
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm

2001-10-19 Thread stas

stas01/10/19 03:37:20

  Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm
  Log:
  - module cleanup, moving XXX/META's into the todo list
  
  Revision  ChangesPath
  1.4   +35 -75modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
  
  Index: RegistryCooker.pm
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RegistryCooker.pm 2001/10/19 07:35:26 1.3
  +++ RegistryCooker.pm 2001/10/19 10:37:20 1.4
  @@ -16,9 +16,6 @@
   our $VERSION = '1.99';
   
   use Apache::compat ();
  -# META: Should not use Apache::compat, the following methods need to
  -# be implemented:
  -# $r-slurp_filename
   
   use Apache::Response;
   use Apache::Log;
  @@ -27,27 +24,10 @@
   use ModPerl::Util ();
   use ModPerl::Global ();
   
  -#
  -# issues
  -#
  -#
  -
  -# META: who sets this? What's the default?
   unless (defined $ModPerl::Registry::MarkLine) {
   $ModPerl::Registry::MarkLine = 1;
   }
   
  -### Optimizations
  -#
  -# - $o-[CLASS] of the subclass is known at compile time, so should
  -#   create the subs using $o-[CLASS] on the fly for each subclass
  -#   which wants them
  -
  -### TODO
  -#
  -# - who handles END/BEGIN/,CHECK,INIT) blocks?
  -# - see META's accross the file
  -
   #
   # debug constants
   #
  @@ -58,9 +38,9 @@
   use constant D_COMPILE = 4;
   use constant D_NOISE   = 8;
   
  -# can override the debug level in httpd.conf with:
  +# the debug level can be overriden on the main server level of
  +# httpd.conf with:
   #   PerlSetVar ModPerl::RegistryCooker::DEBUG 4
  -# on the server level 
   use Apache::ServerUtil ();
   use constant DEBUG =
   defined Apache-server-dir_config('ModPerl::RegistryCooker::DEBUG')
  @@ -96,26 +76,6 @@
   
   
   #
  -# install the aliases into $class
  -#
  -#
  -
  -sub install_aliases {
  -my ($class, $rh_aliases) = @_;
  -
  -no strict 'refs';
  -while (my($k,$v) = each %$rh_aliases) {
  -if (my $sub = *{$v}{CODE}){
  -#warn $class: ok: $k = $v;
  -*{ $class . ::$k } = $sub;
  -}
  -else {
  -die $class: $k aliasing failed; sub $v doesn't exist;
  -}
  -}
  -}
  -
  -#
   # func: new
   # dflt: new
   # args: $class - class to bless into
  @@ -128,7 +88,6 @@
   my($class, $r) = @_;
   my $o = bless [], $class;
   $o-init($r);
  -#$o-debug($$: init class: $class);
   return $o;
   }
   
  @@ -160,7 +119,6 @@
   #   __PACKAGE__, which is tied to the file)
   #
   
  -# META: prototyping ($$) segfaults on request
   sub handler {
   my $class = (@_ = 2) ? shift : __PACKAGE__;
   my $r = shift;
  @@ -219,7 +177,6 @@
   
   $o-flush_namespace;
   
  -# META: handle!
   #$o-chdir_file($Apache::Server::CWD/);
   
   if ( ($rc = $o-error_check) != Apache::OK) {
  @@ -291,9 +248,6 @@
   # make sure that the sub-package doesn't start with a digit
   $package = _$package;
   
  -# META: ??? explain
  -$ModPerl::Registry::curstash = $package;
  -
   # prepend root
   $package = $o-[CLASS] . ::Cache::$package;
   
  @@ -331,12 +285,6 @@
substr($o-[URI], 0, length($o-[URI]) - length($path_info)) :
$o-[URI];
   
  -# META: do we handle this?
  -# if ($ModPerl::Registry::NameWithVirtualHost  $o-[REQ]-server-is_virtual) 
{
  -#  my $name = $o-[REQ]-get_server_name;
  -#  $script_name = join , $name, $script_name if $name;
  -# }
  -
   $script_name =~ s:/+$:/__INDEX__:;
   
   return $script_name;
  @@ -365,10 +313,7 @@
   # relative require/open will work.
   $o-chdir_file;
   
  -# META: what's this?
  -## compile this subroutine into the uniq package name
  -#$o-debug(handler eval-ing) if DEBUG  D_NOISE;
  -#undef {$o-[PACKAGE]\::handler};# unless $Debug  $Debug  4; #avoid 
warnings
  +#undef {$o-[PACKAGE]\::handler}; unless DEBUG  D_NOISE; #avoid warnings
   #$o-[PACKAGE]-can('undef_functions')  $o-[PACKAGE]-undef_functions;
   
   my $line = $o-get_mark_line;
  @@ -385,22 +330,18 @@
   
   my %orig_inc = %INC;
   
  -#warn [-- $eval --];
   my $rc = $o-compile(\$eval);
   $o-debug(qq{compiled package \$o-[PACKAGE]\}) if DEBUG  D_NOISE;
   
  -# META: handle!
   

cvs commit: modperl-2.0/ModPerl-Registry TODO

2001-10-19 Thread stas

stas01/10/19 03:43:25

  Modified:ModPerl-Registry TODO
  Log:
  - summarize things that have to be done for Registry
  
  Revision  ChangesPath
  1.2   +44 -26modperl-2.0/ModPerl-Registry/TODO
  
  Index: TODO
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/TODO,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TODO  2001/10/09 12:47:38 1.1
  +++ TODO  2001/10/19 10:43:25 1.2
  @@ -1,36 +1,54 @@
  -- META tags in the modules
  +RegistryCooker:
   
  
  +### bugs ###
   
  - - print STDERR is buffered in test handlers, whereas warn() works
  -   normally. select() helps, but STDERR should be unbuffered in first
  -   place.
  +- prototyping sub handler($$) segfaults on request
   
  
  +### missing features ###
   
  - what's the replacement of NameWithVirtualHost? Obviously we need something
  - to distinguish between vhs.
  +- need to port $Apache::__T, to test against when user supplies -T flag.
   
  -DougM: well, if possible we should distinguish between the uri and
  -requested resource instead.  in otherwords, we have the: r-uri =
  -r-filename translation, just need to figure out if r-filename is the
  -actual filename or a symlink (readlink can be used to get the real
  -filename).  then create a package based on the filename, but with as
  -few package:: levels as possible (hopefully none beyond
  -ModPerl::RegistryROOT::filename)
  +- port Apache::PerlRunXS
   
  -DougM: using filenames makes for long packages names == lengthy
  -lookups and more memory than we need.  at least the way it is
  -currently implemented where each '/' turns into '::'.  could be that
  -s,/,_,g is good enough, but haven't thought about this for a while.
  -in any case, we should get rid of the NameWithVirtualHost stuff, its
  -caused too many problems in the past.
  +- implement RegistryLoader (per module or a single one?)
   
  
  +- implement slurp_filename and remove Apache::compat
   
  -Bjarni R. Einarsson [EMAIL PROTECTED] has suggested this Registry hack
  -http://marc.theaimsgroup.com/?l=apache-modperl-devm=98961929702745w=2
  -Message-ID: [EMAIL PROTECTED]
  +- $r-chdir_file is not handled/implemented, see todo/api.txt unsafe!
   
  
  +- $Apache::Server::CWD doesn't exist
  +
  +- NameWithVirtualHost is not handled
  +
  +- need to figure out what's happening with
  +  ModPerl::Registry::MarkLine, why it's not on by default?
  +
  +- a cousin of convert_script_to_compiled_handler() in 1.x used to have
  +  'undef {$o-[PACKAGE]\::handler}' to avoid redefine handler()
  +  warnings in case a user has used -w. also see the undef_functions on
  +  the next line.
  +
  +- child_terminate is not implemented see
  +  convert_script_to_compiled_handler().
  +
  +- print STDERR is buffered in test handlers, whereas warn() works
  +  normally. select() helps, but STDERR should be unbuffered in first
  +  place.
  +
  +### optimizations ###
  +
  +- $o-[CLASS] of the subclass is known at compile time, so should
  +  create the subs using $o-[CLASS] on the fly for each subclass
  +  which wants them
  +
  +### nice to have ###
  +
  +- in namespace_from_filename() should test whether a file is a symlink
  +  and if so use readlink() to get the real filename.
  +
  +### other things ###
  +
  +- Bjarni R. Einarsson [EMAIL PROTECTED] has suggested this Registry hack
  +  http://marc.theaimsgroup.com/?l=apache-modperl-devm=98961929702745w=2
  +  Message-ID: [EMAIL PROTECTED]
   
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_time.h

2001-10-19 Thread stas

stas01/10/19 20:35:54

  Modified:src/modules/perl modperl_time.h
  Log:
  - handle platforms which don't have HZ constant defined
  
  Revision  ChangesPath
  1.2   +8 -2  modperl-2.0/src/modules/perl/modperl_time.h
  
  Index: modperl_time.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_time.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- modperl_time.h2001/01/21 23:19:03 1.1
  +++ modperl_time.h2001/10/20 03:35:54 1.2
  @@ -1,6 +1,12 @@
   #ifndef MODPERL_TIME_H
   #define MODPERL_TIME_H
   
  +#ifdef HZ
  +#   define MP_HZ HZ
  +#else
  +#   define MP_HZ 100
  +#endif
  +
   #ifdef MP_TRACE
   #define dMP_TIMES \
   struct tms start_time; \
  @@ -18,9 +24,9 @@
   #define MP_PRINT_TIMES(label) \
   MP_TRACE_t_do({ \
   double utime = \
  - (double)(end_time.tms_utime - start_time.tms_utime)/HZ; \
  + (double)(end_time.tms_utime - start_time.tms_utime)/MP_HZ; \
   double stime = \
  - (double)(end_time.tms_stime - start_time.tms_stime)/HZ; \
  + (double)(end_time.tms_stime - start_time.tms_stime)/MP_HZ; \
   if (utime || stime) { \
   MP_TRACE_t(MP_FUNC, %s %5.2f user %5.2f sys\n, \
  label, utime, stime); \