Re: ePerl (fragment of Re: Apache::SimpleTemplate)
Yea, I tried that, but it was still unhappy. There are apparently a couple of other tweaks that needed to be done. I didn't think too much about it; after the first error, I went looking for information and found the patch. http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/textproc/eperl/Makefile cheers, Todd At 01:21 AM 7/9/01, Mithun Bhattacharya wrote: The only thing I had to fix was that the Makefile didnt know about version 5.6 otherwise it compiled cleanly... Ofcourse there is a issue with a function declaration which gcc didnt like but it got fixed when I commented it out. There's a patch to make it work with 5.6 floating around, but I haven't seen anything else new in some time.
2 questions
hi, I've sent this email to Template-Toolkit mailing list... but there doesn't seem to be anyone, so I'm sending it here ... Could anyone help me out with these ok I have two questions about TT, let me begin with the first one the easier ... I have the folowing situations I have a template like this $vars = { stuff = 'filename.tpl' }; then in the parent template [% INCLUDE $stuff %] Ok the problem is that sometimes I generate the contens on the fly so I can have in $stuff not the file name, but the content itself i.e. $vars = { stuff = 'tabletrtdblah/td/tr/table' } i.e. I need [% $stuff %] not [% INCLUDE $stuff %] How can in the parent template distinguish between these two cases (if scalar place it, if file include it ). There is third case what if it is scalar-template - then we have to parse/process the scalar.. Now the SECOND question : This is mostly related to FORMS ( i've done one module that generate for me forms content, insert/update queries, filled forms from a common config file), so what I need ... I need a way to replace the web-designer inputs,select boxes, textareas with thouse generated from me, but also want to preserve the formating/styles etc.. f.e. Designer wrote (the idea is ): select name=blah size=10 style=... option .. option .. option .. /select input type=text size=10 class=blah I have to remove select input but preserve the size, style and class - replace name with name created by me - and extract input-type for further usage in my script... Also I'm populating the SELECT-options from the DB so I must replace the designers-made with mine. it has to be some sort of callback function that will be called every time the TT hit some form-element... I thought of several variants with using WRAPPER, BLOCK.. !?! which doesn't help me alot possibly this has to be some sort of FILTER ?! has to have the ability to get arguments !?!? May be : [%FILTER parse(tplname=myslect, size=10, style=...)%] select name=blah size=10 style=... option .. option .. option .. /select [%END%] [%FILTER parse(tplname=myin, size=12, class=blah)%] input type=text size=12 class=blah [%END%] Please help me... i haven't written a filter !?! is there any other solution !?!? Thanx alot = iVAN [EMAIL PROTECTED] =
Re: any trick to exclude some files in FilesMatche
Hi there, On Mon, 9 Jul 2001, Surat Singh Bhati wrote: [snip] But all the .pl , including fast_(.*).pl are run by Apache::PerlRun handler [snip] Any solution to exclude the fast_(.*).pl in second expression? Rename the files? 73, Ged.
Re: 2 questions
ivan [EMAIL PROTECTED] said something to this effect on 07/09/2001: ok I have two questions about TT, let me begin with the first one the easier ... *snip* How can in the parent template distinguish between these two cases (if scalar place it, if file include it ). There is third case what if it is scalar-template - then we have to parse/process the scalar.. The parent template cannot distinguish between these cases, nor should it. The mechanisms for INCLUDING files and echoing strings are radically different because of how the grammer is written. Take a look at the Template::Context::include method to see how and where you can override the behavior of INCLUDE by subclassing Template::Context. (darren) -- Nothing worse could happen to one than to be completely understood. -- Carl Gustav Jung
Re: any trick to exclude some files in FilesMatche
On Mon, 9 Jul 2001, Surat Singh Bhati wrote: But all the .pl , including fast_(.*).pl are run by Apache::PerlRun handler Any solution to exclude the fast_(.*).pl in second expression? Set the PerlRun handler as the default in httpd.conf, and write your own translation handler: package Apache::DistinguishBetweenPerlRunAndFastCGI; use Apache::Constants qw(OK DECLINED); sub handler { my $r = shift; return DECLINED unless ($r-uri =~ /\.pl$/); $r-hander(whatever-handler) if ($r-uri =~ /fast_(.*)\.pl$/); return OK; } Season to taste (especially real a handler name). (darren) -- I believe in God, only I spell it Nature. -- Frank Lloyd Wright
RE: re rand bug?
Sorry to be confused, but I believe I did not create a global variable. In the code below that I showed, I used a my to localize the $tmp variable inside the for loop.? Anyway, I changed the simple code and added the use strict and use vars qw($rand), but now I get no random activity at all. Each time a user hits it, they of course receive the same 4 numbers. Not very random I am sure I am screwing this up somehow, was anyone able to get this to work, or able to get 4 random numbers each time they run the snippet of code? Thanks Scott -Original Message- From: Gunther Birznieks [mailto:[EMAIL PROTECTED]] Sent: Friday, July 06, 2001 6:22 PM To: Purcell, Scott; '[EMAIL PROTECTED]' Subject: Re: rand bug? Your problem is likely that the use of a global my is creating a closure (see mod_perl guide). Replace it with use vars qw($rand); and don't declare your globals using my. At 01:07 PM 7/6/2001 -0500, Purcell, Scott wrote: Hello, rand bug with mod_perl? my $rand = int(rand(1000)) always produces '2' under mod_perl. I have noticed that if I ask for the line above, it always puts $rand at a '2'? So I did some test below, looping through and the first time through with mod_perl, the number is always 2? Under investigation when I run the following code under cgi-bin, it works good like it should. 960 is tmp 240 is tmp 193 is tmp 197 is tmp When I run that same code under mod_perl, it looks like this: 2 is tmp 564 is tmp 194 is tmp 809 is tmp So basically if I just need one random number I have to do some excess work? Does anyone know why this is? If anyone wants just drop the following line under cgi-bin and mod_perl and you'll see the results. Please let me know, Scott #! perl use CGI qw/:standard/; my $q = CGI-new; print $q-header(); print $q-start_html(hello); foreach (my $i=1; $i5; $i++) { my $tmp = int(rand(1000)+1); print $tmp is tmpbr\n; } Scott Purcell __ Gunther Birznieks ([EMAIL PROTECTED]) eXtropia - The Open Web Technology Company http://www.eXtropia.com/
Re: re rand bug?
Purcell, Scott [EMAIL PROTECTED] said something to this effect on 07/09/2001: Sorry to be confused, but I believe I did not create a global variable. In the code below that I showed, I used a my to localize the $tmp variable inside the for loop.? Anyway, I changed the simple code and added the use strict and use vars qw($rand), but now I get no random activity at all. Each time a user hits it, they of course receive the same 4 numbers. Not very random I am sure I am screwing this up somehow, was anyone able to get this to work, or able to get 4 random numbers each time they run the snippet of code? Just out of curiosity, are you calling srand explicitly? If not, what happens if you do, and if you are, what happens if you don't? (darren) -- Reisner's Rule of Conceptual Inertia: If you think big enough, you'll never have to do it.
Filter access to Files on Apache
Hello list perhaps it is off-topic (sorry for that, but i hope that somebody of you can help me), but somehow i wish to have a solution with precompiled perl such as mod_perl or ... everything else which fits to my needs. I want to filter every access of for example all .jpg-files on my apache for autentication purposes. I use my own cookie-based authentication mechanisms. So one solution i had was to add a handler Action auth authent.pl AddHanlder auth jpg and in the authent.pl use something like a internal redirection. But the only way i know to get this internal redirection is the following: open(DATEI, ...) print while (DATEI) close(DATEI) So, I'd be glad if you can give me some hints to solve this. Especially in order to efficiency (for that it don't have to be compiled everytime) I'm running apache 1.3.17 with mod_perl on a Linux machine. Thanks in advance! Thomas Bach think karo.. bkaro.net
Re: 2 questions
I've sent this email to Template-Toolkit mailing list... but there doesn't seem to be anyone, so I'm sending it here ... Um, you did send it at 6:30PM on a Sunday (yesterday). Support on that list is really good, but you can't expect everyone to be on the same schedule as you. How can in the parent template distinguish between these two cases (if scalar place it, if file include it ). You could handle this with a plugin. The plugin would determine what kind of thing $stuff is, and then call the appropriate TT methods to handle it. In your template you say something like: [% MY_INCLUDE $stuff %] I need a way to replace the web-designer inputs,select boxes, textareas with thouse generated from me, but also want to preserve the formating/styles etc.. f.e. There are basically two ways people do this. One is to replace the standard HTML elements with your own, e.g. select size=10 name=foo becomes [% form.select(size = 10, name = foo) %]. The other is to post-process the resulting HTML with something like HTML::FillInForm. That could be done inside a FILTER block. If the first appeals to you more, but you don't want your designers to have to think about it, you could pre-process the templates to translate the form elements to TT syntax. There's plenty of documentation for this module that covers the details of plugins and filters. - Perrin
RE: re rand bug?
On Mon, 9 Jul 2001, Purcell, Scott wrote: Sorry to be confused, but I believe I did not create a global variable. In the code below that I showed, I used a my to localize the $tmp variable inside the for loop.? Anyway, I changed the simple code and added the use strict and use vars qw($rand), but now I get no random activity at all. Each time a user hits it, they of course receive the same 4 numbers. Not very random I am sure I am screwing this up somehow, was anyone able to get this to work, or able to get 4 random numbers each time they run the snippet of code? Scott, You should start with a simple test script, like this: #!/usr/bin/perl -wT my $r = shift; $r-send_http_header(text/plain); $r-print($$ rand: .rand().\n); which does the right thing and then work on extending it to your case, step by step, checking after every extra code addition (which affects the rand()). Of course the testing should happen under httpd -X. Another reason for this weird behavior might be explicit srand() run in the parent (via startup.pl), and then all children will always start rand() from the same IV, since PRG will be initialized to the same value. You cannot detect this with -X mode, on the opposite -- you have to run this in the normal multi-server mode. The above example works for me. if I add: srand(time); in startup.pl it does exactly what you are expreriencing. So I guess that's the real reason for your problem and not the closure effect. Thanks Scott -Original Message- From: Gunther Birznieks [mailto:[EMAIL PROTECTED]] Sent: Friday, July 06, 2001 6:22 PM To: Purcell, Scott; '[EMAIL PROTECTED]' Subject: Re: rand bug? Your problem is likely that the use of a global my is creating a closure (see mod_perl guide). Replace it with use vars qw($rand); and don't declare your globals using my. At 01:07 PM 7/6/2001 -0500, Purcell, Scott wrote: Hello, rand bug with mod_perl? my $rand = int(rand(1000)) always produces '2' under mod_perl. I have noticed that if I ask for the line above, it always puts $rand at a '2'? So I did some test below, looping through and the first time through with mod_perl, the number is always 2? Under investigation when I run the following code under cgi-bin, it works good like it should. 960 is tmp 240 is tmp 193 is tmp 197 is tmp When I run that same code under mod_perl, it looks like this: 2 is tmp 564 is tmp 194 is tmp 809 is tmp So basically if I just need one random number I have to do some excess work? Does anyone know why this is? If anyone wants just drop the following line under cgi-bin and mod_perl and you'll see the results. Please let me know, Scott #! perl use CGI qw/:standard/; my $q = CGI-new; print $q-header(); print $q-start_html(hello); foreach (my $i=1; $i5; $i++) { my $tmp = int(rand(1000)+1); print $tmp is tmpbr\n; } Scott Purcell __ Gunther Birznieks ([EMAIL PROTECTED]) eXtropia - The Open Web Technology Company http://www.eXtropia.com/ _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: announce: mod_perl-1.25_01
On Sat, 7 Jul 2001, Stas Bekman wrote: On Fri, 6 Jul 2001, Doug MacEachern wrote: all tests pass cleanly. cool. under bleed-perl (one week old compilation) (the rest is the same) there are some problems: (perl build args are at the end of this post) $ ./t/TEST -v modules/cgi fails to start the server, whereas 1.xx never did start the server like that, its a 2.0 only feature. $ make start_httpd cp t/conf/mod_perl_srm.conf t/conf/srm.conf ../apache_1.3.20/src/httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t httpd listening on port 8529 will write error_log to: t/logs/error_log letting apache warm up...\c done (it reports 'done' even if it's failed to start the server, because there was another server running already on the same port. try to run 'make start_httpd' twice in a row and you will see) $ more t/logs/error_log [Sat Jul 7 20:55:01 2001] [crit] (98)Address already in use: make_sock: could not bind to port 8529 same problem if you 'make test' and there's already a server running. has always been this way. 2.0 however, first tests that the port is available before attempting to start the server. reason: [Sat Jul 7 20:57:02 2001] [error] (13)Permission denied: exec of /usr/src/httpd_perl/mod_perl-1.25_01/t/net/perl/cgi.pl failed [Sat Jul 7 20:57:02 2001] [error] [client 127.0.0.1] Premature end of script headers: /usr/src/httpd_perl/mod_perl-1.25_01/t/net/perl/cgi.pl this only happens when running this test standalone or also during full 'make test' ? is it setup to use the correct perl? % head -1 t/net/perl/cgi.pl build warnings: ... mod_perl.c:333: warning: unused variable `my_perl' these have also been here as long as ithreads, left as a reminder, 1.xx should be optimized for ithreads.
PerlInitHandler and PerlSetEnv
All, I've noticed some odd behavior (or maybe just errant thinking on my part) concerning PerlInitHandler and PerlSetEnv. While walking through the demo of HTML::EmbperlObject, things were just not working as advertised. This configuration: Location /foo PerlSetEnv EMBPERL_OBJECT_BASE base.htm PerlSetEnv EMBPERL_FILESMATCH \.htm.?|\.epl$ SetHandler perl-script PerlHandler HTML::EmbperlObject Options ExecCGI /Location caused problems (error log had messages about being unable to find EMBPERL_OBJECT_BASE) This configuration works fine: PerlSetEnv EMBPERL_OBJECT_BASE base.htm PerlSetEnv EMBPERL_FILESMATCH \.htm.?|\.epl$ Location /foo SetHandler perl-script PerlHandler HTML::EmbperlObject Options ExecCGI /Location I somewhat traced the problem down to a PerlInitHandler: PerlInitHandler Apache::StatINC If that is set (or any other PerlInitHandler is set), PerlSetEnv's inside Location directives (or Directory directives) do not work. If there are no PerlInitHandlers, the PerlSetEnv's inside Location directives do work. It's not an embperl thing - I have a simple script that just spits out ENV that will demonstrate the issue. Is this normal expected behavior? The docs lead me to believe not but ... I've tried this on two configurations and both produce the same results: Configuration one: Digital OSF1 V4.0 Apache/1.3.20 perl 5.6.1 mod_perl 1.21 Configuration two: PowerPC DebianGnu Linux Apache/1.3.9 perl 5.5.3 mod_perl 1.21.03 Any pointers to further info would be greatly appreciated, -MikeB.
Re: announce: mod_perl-1.25_01
under bleed-perl (one week old compilation) (the rest is the same) there are some problems: (perl build args are at the end of this post) $ ./t/TEST -v modules/cgi fails to start the server, whereas 1.xx never did start the server like that, its a 2.0 only feature. I'm spoiled with 2.0 :) reason: [Sat Jul 7 20:57:02 2001] [error] (13)Permission denied: exec of /usr/src/httpd_perl/mod_perl-1.25_01/t/net/perl/cgi.pl failed [Sat Jul 7 20:57:02 2001] [error] [client 127.0.0.1] Premature end of script headers: /usr/src/httpd_perl/mod_perl-1.25_01/t/net/perl/cgi.pl this only happens when running this test standalone or also during full 'make test' ? is it setup to use the correct perl? % head -1 t/net/perl/cgi.pl A correct one. But I cannot reproduce the problem anymore. I've recompiled with 5.6.1 and then back with bleed-perl, and it's fine now. Sorry about that. _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Accessing server config during parent startup
Hi, I'm having trouble trying to access server config directives during parent startup. Basically, I've got a module which needs to access a configuration directive in order to compile some non-Perl files to Perl while the server starts and before children are created so that the code they generate will stay shared. The directive I need access to is defined by AxKit, so I can play with the source code that defines it to make it available to Perl at that time. In order to access the configuration, I'm using (in a nutshell): cfg = (axkit_dir_config *) ap_get_module_config(s-module_config, XS_AxKit); where s is an Apache::Server object mapped to T_PTROBJ in the typemap. The code is working and now returns a cfg that exists but hasn't been initialised, ie it is as if no directives had been read at all (or so it seems). However, it is clear that the code is called after the directives have been read. This may all be due to a problem in my code, but before I go on and go insane, I wondered if using the server object thus has any chance of working, and if there is a description of the right way to do this somewhere. Thanks ! -- ___ Robin Berjon [EMAIL PROTECTED] -- CTO k n o w s c a p e : // venture knowledge agency www.knowscape.com --- Oops. My Brain just hit a bad sector.
ASP.pm and script %main (name-table) !?
hi, How can I access the current script name-table from module. I'm currently using : $main::XXX = 123; Then in the script : print $XXX; but this access the ASP %main not the script %main ... Is there a way to access script main package and pull data there I'm working with ASP.pm-mod_perl thanx alot = iVAN [EMAIL PROTECTED] =
Re: Apache::SimpleTemplate (don't do it!)
hi, i'm sure many of us have had situations like this, but that doesn't mean that everyone who wants to do some templating is going to fall into the same trap every time. to clarify what i mean by 'simple': - trivial to install and to use - small disk footprint 10 modules total. preferably 1 - small memory footprint this is usually the first bottleneck i see with mod_perl. i don't know how big these others systems get, but with the high numbers of modules... - fast, with little overhead to begin with. just because they're mod_perl, does not mean they're fast enough. - very basic non-syntax it's either code or it's not. no added tags, etc. - extensibility via sub-classing. i really think these criteria are reasonable, and that there should be such a minimal approach available. (i just did some quick tests against Embperl, and my memory and speed concerns are justified.) most projects may still be better off using Embperl, Mason, ASP, TT from the beginning. But all should not be forced to just because others had bad experiences when they started out with a basic templating scheme. i am still waiting for some direct positive feedback, though. :) peter
RE: Accessing server config during parent startup
-Original Message- From: Robin Berjon [mailto:[EMAIL PROTECTED]] Sent: Monday, July 09, 2001 11:58 AM To: [EMAIL PROTECTED] Subject: Accessing server config during parent startup Hi, I'm having trouble trying to access server config directives during parent startup. Basically, I've got a module which needs to access a configuration directive in order to compile some non-Perl files to Perl while the server starts and before children are created so that the code they generate will stay shared. The directive I need access to is defined by AxKit, so I can play with the source code that defines it to make it available to Perl at that time. In order to access the configuration, I'm using (in a nutshell): cfg = (axkit_dir_config *) ap_get_module_config(s-module_config, XS_AxKit); I only just skimmed the sources, but I don't think it is possible. AxKit populates the per-dir config, not the per-server config, and you need a request record to dig out the per-dir config. interesting to see what Matt says, though... --Geoff
can't start apache-1.3.20 with mod_perl and Mason
Hi, After upgrading my installation to Apache-1.3.20 and mod_perl-1.25 as as a module I can't start apache anymore when httpd.conf contains: PerlRequire /etc/apache/perl/handler.pl And that file (for debugging purposes) is practically empty: #!/usr/bin/perl package HTML::Mason; use strict; use HTML::Mason; use HTML::Mason::ApacheHandler; 1; Running strace apache -X shows: read(3, ETE PATCH PROPPATCH MKCOL COPY M..., 4096) = 4096 read(3, mLog directive (see below).\n#\nLo..., 4096) = 4096 read(3, n /icons/uuencoded.gif .uu\nA..., 4096) = 4096 read(3, tweak mime.types without actual..., 4096) = 4096 --- SIGSEGV (Segmentation fault) --- +++ killed by SIGSEGV +++ There no helpful message in the error.log about the reason of apache's crash. I am running a debian unstable system. Thanks in advance for any suggestion, -- THESEE: La Grèce, à qui mon bras fut tant de fois utile, A-t-elle au criminel accordé quelque asile ? (Phèdre, J-B Racine, acte 3, scène 5)
Re: Filter access to Files on Apache
[EMAIL PROTECTED] (Thomas Bach) wrote: perhaps it is off-topic (sorry for that, but i hope that somebody of you can help me), but somehow i wish to have a solution with precompiled perl such as mod_perl or ... everything else which fits to my needs. I want to filter every access of for example all .jpg-files on my apache for autentication purposes. I use my own cookie-based authentication mechanisms. So one solution i had was to add a handler Action auth authent.pl AddHanlder auth jpg and in the authent.pl use something like a internal redirection. But the only way i know to get this internal redirection is the following: open(DATEI, ...) print while (DATEI) close(DATEI) If you want to directly send a file, use: open(DATEI, ...) $r-send_fd(DATEI) close(DATEI) You can do an internal redirect using subrequests, if you want. See $r-lookup_uri(). But I'm not sure why you need to redirect just to authenticate. Can't you just deny access if authentication fails, and allow it if it succeeds? ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Re: announce: mod_perl-1.25_01
Doug, I didn't see in the announcement that the below fix is included in 1.25_01. Can you please confirm? Regards, Christian -Original Message- From: Doug MacEachern [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 15, 2000 7:59 PM To: [EMAIL PROTECTED] Cc: 'Modperl Mailing List (E-mail)' Subject: Re: Yet more on set_handlers() and new-found problems with lookup_uri() i think the jist of the problem(s), is that set_handlers() modifies the configuration structure (the one created at startup from httpd.conf), so any subrequests will end up with the modified structure (which is not reset until the end of the request). this patch implements {get,set}_handlers in terms of r-per_request_config, which is unique to each (sub-)request. if this doesn't fix the problem, it would really help to have a small test case that i can drop in to see the bug in action. Index: src/modules/perl/Apache.xs === RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v retrieving revision 1.103 diff -u -r1.103 Apache.xs --- src/modules/perl/Apache.xs 2000/08/15 19:36:32 1.103 +++ src/modules/perl/Apache.xs 2000/08/16 00:46:44 @@ -73,12 +73,6 @@ void (*set_func) (void *, void *, SV *); } perl_handler_table; -typedef struct { -I32 fill; -AV *av; -AV **ptr; -} perl_save_av; - static void set_handler_dir (perl_handler_table *tab, request_rec *r, SV *sv); static void set_handler_srv (perl_handler_table *tab, request_rec *r, SV *sv); @@ -101,28 +95,17 @@ {HandlerDirEntry(PerlFixupHandler, PerlFixupHandler)}, {HandlerDirEntry(PerlHandler, PerlHandler)}, {HandlerDirEntry(PerlLogHandler, PerlLogHandler)}, +{HandlerDirEntry(PerlCleanupHandler, PerlCleanupHandler)}, { FALSE, NULL } }; -static void perl_restore_av(void *data) -{ -perl_save_av *save_av = (perl_save_av *)data; - -if(save_av-fill != DONE) { -AvFILLp(*save_av-ptr) = save_av-fill; -} -else if(save_av-av != Nullav) { -*save_av-ptr = save_av-av; -} -} - static void perl_handler_merge_avs(char *hook, AV **dest) { int i = 0; HV *hv = perl_get_hv(Apache::PerlStackedHandlers, FALSE); SV **svp = hv_fetch(hv, hook, strlen(hook), FALSE); AV *base; - + if(!(svp SvROK(*svp))) return; @@ -133,45 +116,53 @@ } } +#define avptr_from_offset(ptr, tab) \ +(AV **)((char *)ptr + (int)(long)tab-offset) + static void set_handler_base(void *ptr, perl_handler_table *tab, pool *p, SV *sv) { -AV **av = (AV **)((char *)ptr + (int)(long)tab-offset); +int do_register_cleanup = 0; +AV **av = avptr_from_offset(ptr, tab); -perl_save_av *save_av = -(perl_save_av *)palloc(p, sizeof(perl_save_av)); - -save_av-fill = DONE; -save_av-av = Nullav; - -if((sv == sv_undef) || (SvIOK(sv) SvIV(sv) == DONE)) { -if(AvTRUE(*av)) { -save_av-fill = AvFILL(*av); -AvFILLp(*av) = -1; -} -} -else if(SvROK(sv) SvTYPE(SvRV(sv)) == SVt_PVAV) { -if(AvTRUE(*av)) -save_av-av = av_copy_array(*av); -*av = (AV*)SvRV(sv); -++SvREFCNT(*av); +if ((sv == sv_undef) || (SvIOK(sv) SvIV(sv) == DONE)) { +if (!*av) { +do_register_cleanup = 1; +} +if (*av SvREFCNT(*av)) { +SvREFCNT_dec(*av); +} +*av = newAV(); +} +else if (SvROK(sv) SvTYPE(SvRV(sv)) == SVt_PVAV) { +*av = (AV*)SvRV(sv); +++SvREFCNT(*av); +do_register_cleanup = 1; } else { -croak(Can't set_handler with that value); +croak(Can't set_handler with that value); +} + +if (do_register_cleanup) { +register_cleanup(p, (void*)*av, mod_perl_cleanup_av, mod_perl_noop); } -save_av-ptr = av; -register_cleanup(p, save_av, perl_restore_av, mod_perl_noop); } -static void set_handler_dir(perl_handler_table *tab, request_rec *r, SV *sv) +void set_handler_dir(perl_handler_table *tab, request_rec *r, SV *sv) { -dPPDIR; -set_handler_base((void*)cld, tab, r-pool, sv); +dPPREQ; +if (!cfg-dir_cfg) { +cfg-dir_cfg = perl_create_dir_config(r-pool, r-uri); +} +set_handler_base((void*)cfg-dir_cfg, tab, r-pool, sv); } static void set_handler_srv(perl_handler_table *tab, request_rec *r, SV *sv) { -dPSRV(r-server); -set_handler_base((void*)cls, tab, r-pool, sv); +dPPREQ; +if (!cfg-srv_cfg) { +cfg-srv_cfg = perl_create_server_config(r-pool, NULL); +} +set_handler_base((void*)cfg-srv_cfg, tab, r-pool, sv); } static perl_handler_table *perl_handler_lookup(char *name) @@ -185,29 +176,45 @@ return NULL; } - static SV *get_handlers(request_rec *r, char *hook) { AV *avcopy; AV **av; +dPPREQ; dPPDIR; dPSRV(r-server);
Re: Apache::SimpleTemplate (don't do it!)
hi, i'm sure many of us have had situations like this, but that doesn't mean that everyone who wants to do some templating is going to fall into the same trap every time. The problem is that not every feature comes off looking like a trap. - trivial to install and to use It's rare that I need to do anything more than 'perl Makefile.PL make make install' when I install modules. If I use CPAN.pm, it's even easier. Installation of any perl module trivial (under Un*x, at least). - small disk footprint I can't remember the last time I had a disk space problem because of a perl module. It's not like we're talking about Megs of disk space (TT might come close). 2 gigs will hold all of RH 7.0 (including X) and any perl modules you could possibly want. - small memory footprint At current memory prices (128 MB for $25), I consider this point very weak. I use about 300 modules within my system, and the total size of the httpd is 30 MB. On a system with 1 GB of RAM, I can run about 200 processes easily. Most people don't have 300 modules, so I suspect httpd to be much smaller. - fast, with little overhead to begin with. You don't use a templating system because it's fast. You use it because it's faster to develop. It's the same reason people choose to use Perl instead of C. - very basic non-syntax I'm a little confused by this one There are templating system like Mason that have their own tags ([+ +]) and systems like Text::Template that use HTML style tags. Both are pretty easy for programmers to understand, but designers (the people using the templating system) will probably find Text::Template simpler and easier to learn and use. - extensibility via sub-classing. This is notably where many templating systems come up short. I think TemplateToolkit provides the most flexibility in this area. Text::Template, while not sub-classable, is easily wrapped. I'm not trying to suggest that what you've written isn't worthy. I'm only making a point about templating systems. If your goal is to write a templating system, you shouldn't just look at what already exists and strip out the stuff you feel isn't important. If you really want to help, you should consider contributing to existing templating systems to find the happy medium you're looking for. Robert Landrum -- A good magician never reveals his secret; the unbelievable trick becomes simple and obvious once it is explained. So too with UNIX.
switch user id
As you know, apache runs as nobody.nogroup so these are the files I'm allowed to access. I wish to access files owned by otheruser.othergroup. How can I do this under mod_perl (mason) ? Is there a thing I can use to change my current uid so I can read the file or directory I don't own ? I don't want/cann't modify file permissions or ownership. Regards, Mire -- In a world without fences who needs Gates?
Re: Apache::SimpleTemplate (don't do it!)
On Mon, Jul 09, 2001 at 12:00:58PM -0400, [EMAIL PROTECTED] took time to write: to clarify what i mean by 'simple': - trivial to install and to use - small disk footprint 10 modules total. preferably 1 - small memory footprint this is usually the first bottleneck i see with mod_perl. i don't know how big these others systems get, but with the high numbers of modules... - fast, with little overhead to begin with. just because they're mod_perl, does not mean they're fast enough. - very basic non-syntax it's either code or it's not. no added tags, etc. - extensibility via sub-classing. I think that CGI::FastTemplate does all of that. Please have a look at it, and see if everything you need is not already in it. CGI::FastTemplate 1 module, very fast, no syntax (no loop, etc...), should be subclassable but what for ? I am just using it for years with CGI first and now with mod_perl without any problems whatsoever. My two euro cents. -- Patrick. ``C'est un monde qui n'a pas les moyens de ne plus avoir mal.''
Re: switch user id
As far as I know, it does not exist now, but I believe it WILL be possible with Apache 2.0/mod_perl 2. Issac - Original Message - From: Miroslav Madzarevic [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 09, 2001 19:02 Subject: switch user id As you know, apache runs as nobody.nogroup so these are the files I'm allowed to access. I wish to access files owned by otheruser.othergroup. How can I do this under mod_perl (mason) ? Is there a thing I can use to change my current uid so I can read the file or directory I don't own ? I don't want/cann't modify file permissions or ownership. Regards, Mire -- In a world without fences who needs Gates?
Re: Accessing server config during parent startup
On Monday 09 July 2001 18:09, Geoffrey Young wrote: From: Robin Berjon [mailto:[EMAIL PROTECTED]] In order to access the configuration, I'm using (in a nutshell): cfg = (axkit_dir_config *) ap_get_module_config(s-module_config, XS_AxKit); I only just skimmed the sources, but I don't think it is possible. AxKit populates the per-dir config, not the per-server config, and you need a request record to dig out the per-dir config. Yes, that much I know (there's a lot more to it, but I tried to boil it down to a simple description in order to make it palatable). Having a request object at server startup is not possible, or would be a hack which I'd rather avoid. I added a server config creator which is an exact copy of the per-directory config creator to the module struct, except that it takes a server_rec as its second arg instead of a string. Perhaps I need to do something with that server_rec (eg set the module config on it instead of simply returning it), but I wasn't able to find anything helpful in the Apache docs (I might have missed though, pointers welcome). interesting to see what Matt says, though... Matt probably won't be back for a while, which is why I'm posting here instead of pestering him directly on #axkit ;-) -- ___ Robin Berjon [EMAIL PROTECTED] -- CTO k n o w s c a p e : // venture knowledge agency www.knowscape.com --- The only sensible way to estimate the stability of a Windows server is to power it down and try it out as a step ladder. -- Robert Crawford, in the Monastery
Re: Apache::SimpleTemplate (don't do it!)
I think that CGI::FastTemplate does all of that. Please have a look at it, and see if everything you need is not already in it. It's a good module for CGI, since it doesn't rely on caching/compiling techniques, just simple regex stuff. It will use a lot less RAM than tools that compile in-line perl, because it doesn't eval anything or cache anything. The only real downside of this module is that coding repeated sections (loops) can't be done in-line, i.e. you have to use multiple files. That's a bit of a pain. - Perrin
Re: Apache::SimpleTemplate (don't do it!)
to clarify what i mean by 'simple': - trivial to install and to use That's important - small disk footprint 10 modules total. preferably 1 disks are cheap, so it doesn't matter if you take one or two MB - small memory footprint this is usually the first bottleneck i see with mod_perl. i don't know how big these others systems get, but with the high numbers of modules... As soon as you start to precompile the Perl code inside your template, your memory footprint will increase and will be much more than what your module takes. If you don't precompile the Perl code you will never get a good performance for bigger pages. - fast, with little overhead to begin with. just because they're mod_perl, does not mean they're fast enough. see above. - very basic non-syntax it's either code or it's not. no added tags, etc. That's a matter of taste - extensibility via sub-classing. This makes sense, but Perl methods are not the fasted solution, so you may decide, do you want a good design are a fast one... i really think these criteria are reasonable, and that there should be such a minimal approach available. (i just did some quick tests against Embperl, and my memory and speed concerns are justified.) Before you don't have a real application that does more the Hello World , nothing is justified. (and I can't imagine how you have tested it with a real application, when it is a quick test) (If you want to test against Embperl you should use 2.0b3 which is much faster then 1.3.x!) Of course I can be fast, when I do nearly nothing, but if you want to create applications, that do more then just mailing a form, you have to do a lot of things more and all those things will take time and memory, regardless if your template system does them for you, or if you reinvent them again for every web application you write. most projects may still be better off using Embperl, Mason, ASP, TT from the beginning. But all should not be forced to just because others had bad experiences when they started out with a basic templating scheme. i am still waiting for some direct positive feedback, though. :) It's your decision, but I think you waste your time while you make all the experiences the other had made during the last 3-5 years. I think it would more helpfull if you help to improve the other modules (for example makeing them easier to install etc.) ...but I know that's useless to say, mostly everybody has to write his own templating solution... Gerald P.S. I guess we would have much better ones, if we don't have hundreds of them all doing nearly the same ! - 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: Apache::SimpleTemplate (don't do it!)
On Monday 09 July 2001 20:19, Gerald Richter wrote: to clarify what i mean by 'simple': - trivial to install and to use That's important Tough some are easy to use and hard to install :) The latter is less important imho, when a module is hard to install it's usually justified somehow, and most of the time the community revolving around it will be prepared to help. - small disk footprint 10 modules total. preferably 1 disks are cheap, so it doesn't matter if you take one or two MB To go further, I certainly wouldn't mind an app taking 500mb if it does everything I want it to do fast and well. - small memory footprint this is usually the first bottleneck i see with mod_perl. i don't know how big these others systems get, but with the high numbers of modules... As soon as you start to precompile the Perl code inside your template, your memory footprint will increase and will be much more than what your module takes. If you don't precompile the Perl code you will never get a good performance for bigger pages. Which is why imho for anything non-trivial things must be pre-compiled, and after that one can start discussing the ways in which different modules can unload some templates to save some memory, or do various things to increase their caching. dreamIt would be great if this was handled consistently accross all templating systems so that improvements there would benefit everyone. It doesn't seem impossible given that all that's stored is some Perl code and perhaps some metadata./dream - extensibility via sub-classing. This makes sense, but Perl methods are not the fasted solution, so you may decide, do you want a good design are a fast one... extensibility yes, but sub-classing is only one way to do that, and not always the best. ...but I know that's useless to say, mostly everybody has to write his own templating solution... Until you've written your own you can't understand just how hard it is. I'm slow so I had to write three half-baked ones before I got it, and I'm very glad I didn't release them... There are times when release often doesn't apply all that well :) P.S. I guess we would have much better ones, if we don't have hundreds of them all doing nearly the same ! Agreed, but that probably won't happen... -- ___ Robin Berjon [EMAIL PROTECTED] -- CTO k n o w s c a p e : // venture knowledge agency www.knowscape.com --- Change is inevitable except from a vending machine.
Re: Accessing server config during parent startup
On Monday 09 July 2001 19:38, Robin Berjon wrote: On Monday 09 July 2001 18:09, Geoffrey Young wrote: From: Robin Berjon [mailto:[EMAIL PROTECTED]] In order to access the configuration, I'm using (in a nutshell): cfg = (axkit_dir_config *) ap_get_module_config(s-module_config, XS_AxKit); I added a server config creator which is an exact copy of the per-directory config creator to the module struct, except that it takes a server_rec as its second arg instead of a string. Perhaps I need to do something with that server_rec (eg set the module config on it instead of simply returning it), but I wasn't able to find anything helpful in the Apache docs (I might have missed though, pointers welcome). It would seem (if I understand correctly) that my cfg is only finally initialized after the server merge and dir merge have been called, but that unfortunately Perl sections are called before that... Can anyone confirm this ? And if it is the case, is there a way I can work around that problem, eg by defining some handler code to be called after merging but before children are created ? Thanks ! -- ___ Robin Berjon [EMAIL PROTECTED] -- CTO k n o w s c a p e : // venture knowledge agency www.knowscape.com --- Always remember you're unique just like everyone else.
CGI module or Apache
Hello, I've been using the CGI PERL module for a while now and I like using it a lot. But I was wondering if using that module with mod_perl will slow things down because of the extra module being used. If so, is there a way to use the Apache API and mod_perl to deal with form submissions, cookies and the like? You'll have to forgive me, I've been learning mod_perl off of the cheat sheet at refcards.com. Kevin Schroeder
Re: CGI module or Apache
--- Kevin Schroeder [EMAIL PROTECTED] wrote: Hello, I've been using the CGI PERL module for a while now and I like using it a lot. But I was wondering if using that module with mod_perl will slow things down because of the extra module being used. If so, is there a way to use the Apache API and mod_perl to deal with form submissions, cookies and the like? You'll have to forgive me, I've been learning mod_perl off of the cheat sheet at refcards.com. lol -- well, we don't *HAVE* to forgive you ;o] The CGI module is your best bet for most processing of those sorts, but you can still use mod_perl. Anything you add will swell the footprint of your server a bit, but if you have the resources, CGI.pm is worth a little bloat. Just use it in your handlers normally. It'll only be included once per process, . . . right? __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/
Re: The latest templating system: PSP in DDJ
At 01:01 AM 07/08/01 -0400, Perrin Harkins wrote: The latter gives you the ability to develop custom tag modules to encapsulate complex server-side behaviors and business rules into simple XML-like elements that content developers can use. PSP shares the same basic elements with JSP... Good grief! This sounds exactly like Apache::ASP with its XMLSubs feature. I give up. - Perrin Dear Perrin Don't give up. What is needed, IMHO, is a clear framework,/description/phlogeny/geneology of perl templating systems. Yes, TMTOWTDI is good, and yes, the tendency of open source programmers to write programs that scratches their itch is good, but it is also good to do so in the context of an appropriate amount of organization. CPAN is a good example. Lots of modules, ORGANIZED BY CATEGORY. CPAN is incredibly useful. But I believe CPAN would benefit by one more step of organization: a czar of each category. The czar would be see to it that his category has an Overview Document that includes topics like an overview of the topic (think of using encryption when you have never studied it), available modules and what they do and why, when to use which module, links to related materials, etc. He would also help create a framework or architecture for the module space: map out a list of modules that would adequately cover the topic, including levels for major modules of full, middlin, and lite versions. Keep a list of what needs to be done, so people will improve the existing wheels instead of inventing new ones. A framework would help categorize the numerous modules that can accumulate, some major and several minor -- perhaps an overflow bin where tiny modules that don't warrant inclusion in the major module space can reside. Templating systems is an excellent candidate for this. Just some thoughts. Ron
Re: CGI module or Apache
For the complex programs on the site I'm building I will be using CGI.pm, but there are a few parts of the site where there is little browser-server interaction other than to send a certain page based on the query string and a cookie. Because these pages get refreshed a lot I'm thinking that using a mod_perl based alternative to CGI.pm might be a good way to coax a little extra out of the server. It would only be used once per request from the browser. Would this make a difference since it will be used multiple times on a process, but only once per request? Kevin - Original Message - From: Paul [EMAIL PROTECTED] To: Kevin Schroeder [EMAIL PROTECTED]; modperl [EMAIL PROTECTED] Sent: Monday, July 09, 2001 3:09 PM Subject: Re: CGI module or Apache --- Kevin Schroeder [EMAIL PROTECTED] wrote: Hello, I've been using the CGI PERL module for a while now and I like using it a lot. But I was wondering if using that module with mod_perl will slow things down because of the extra module being used. If so, is there a way to use the Apache API and mod_perl to deal with form submissions, cookies and the like? You'll have to forgive me, I've been learning mod_perl off of the cheat sheet at refcards.com. lol -- well, we don't *HAVE* to forgive you ;o] The CGI module is your best bet for most processing of those sorts, but you can still use mod_perl. Anything you add will swell the footprint of your server a bit, but if you have the resources, CGI.pm is worth a little bloat. Just use it in your handlers normally. It'll only be included once per process, . . . right? __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/
Re: CGI module or Apache
Paul [EMAIL PROTECTED] writes: Just use it in your handlers normally. It'll only be included once per process, . . . right? Put it in startup.pl and it'll get mostly shared too! -- Dave Hodgkinson, http://www.hodgkinson.org Editor-in-chief, The Highway Star http://www.deep-purple.com Interim CTO, web server farms, technical strategy
Re: CGI module or Apache
Take a look at http://perl.apache.org/guide/ and read the stuff on libapreq. - Perrin
Re: The latest templating system: PSP in DDJ
Ron Pero sent the following bits through the ether: Don't give up. What is needed, IMHO, is a clear framework,/description/phlogeny/geneology of perl templating systems. FWIW, Greg McCarroll is writing an article for perl.com on a short comparison of templating systems, and of course we'll have a talk on the subject at TPC by Perrin. Leon ps we've just had a templating flamewar on the london.pm-list, so please let it die down here too ;-) http://london.pm.org/pipermail/london.pm/2001-June/000681.html -- Leon Brocard.http://www.astray.com/ Iterative Software...http://www.iterative-software.com/ ... You seem a decent fellow, I hate to kill you
Re: CGI module or Apache
There's Apache::Request, which is the equivalent of CGI.pm in the areas of form submissions and Apache::Cookie for cookie handling. If you're not using the HTML rendering capabilities of CGI.pm, you may look into those two. --Alex Kevin Schroeder wrote: Hello, I've been using the CGI PERL module for a while now and I like using it a lot. But I was wondering if using that module with mod_perl will slow things down because of the extra module being used. If so, is there a way to use the Apache API and mod_perl to deal with form submissions, cookies and the like? You'll have to forgive me, I've been learning mod_perl off of the cheat sheet at refcards.com. Kevin Schroeder
Re: CGI module or Apache
--- Kevin Schroeder [EMAIL PROTECTED] wrote: For the complex programs on the site I'm building I will be using CGI.pm, but there are a few parts of the site where there is little browser-server interaction other than to send a certain page based on the query string and a cookie. Because these pages get refreshed a lot I'm thinking that using a mod_perl based alternative to CGI.pm might be a good way to coax a little extra out of the server. If that's all you need, then the API will handle it without CGI.pm It would only be used once per request from the browser. Would this make a difference since it will be used multiple times on a process, but only once per request? CGI has a lot of code that saves you from having to roll your own, but if you want to squeeze those extra few cycles out of it It will make a small difference, and will be noticeable on a server that's being pounded hard enough. __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail http://personal.mail.yahoo.com/
Re: CGI module or Apache
Dave Hodgkinson [EMAIL PROTECTED] said something to this effect on 07/09/2001: Paul [EMAIL PROTECTED] writes: Just use it in your handlers normally. It'll only be included once per process, . . . right? Put it in startup.pl and it'll get mostly shared too! Is that anything like being mostly dead? (darren) -- For large values of one, one equals two, for small values of two.
Re: The latest templating system: PSP in DDJ
What is needed, IMHO, is a clear framework,/description/phlogeny/geneology of perl templating systems. I'm writing such a beast for TPC this month, and will publish it when it's ready. I'm not covering every templating module on CPAN though, just the ones that people seem to actually use based on mailing list traffic. (Don't e-mail your But I use such and such messages yet. Wait until you see my list.) This is mostly for sanity purposes -- there's just too many to cover all of them in a meaningful way. It won't solve all the world's problems, but it might help some people find a tool that suits them. - Perrin
Re: Filter access to Files on Apache
[EMAIL PROTECTED] (Thomas Bach) wrote: At 11:17 09/07/01 -0500, you wrote: If you want to directly send a file, use: open(DATEI, ...) $r-send_fd(DATEI) close(DATEI) You can do an internal redirect using subrequests, if you want. See $r-lookup_uri(). what kind of object is $r ? CGI? It's the Apache request object. See 'perldoc Apache' or 'perldoc mod_perl'. But I'm not sure why you need to redirect just to authenticate. Can't you just deny access if authentication fails, and allow it if it succeeds? yes, this is what i want to do, but how do I make this over an apache handler (or sth. similar)? sorry, I'm not that deep in this stuff, but I hope once I'll get it. It sounds like perhaps you should take a look at the book Writing Apache Modules with Perl and C from O'Reilly. There are many ways you could do this, and a book like that will give you a sense of the issues involved. ------ Ken Williams Last Bastion of Euclidity [EMAIL PROTECTED]The Math Forum
Re: The latest templating system: PSP in DDJ
FWIW, Greg McCarroll is writing an article for perl.com on a short comparison of templating systems, and of course we'll have a talk on the subject at TPC by Perrin. Ahhh, 'short'. But that's another problem. I realize such articles are hard work, but (especially for those of us struggling to choose a templating system) is anybody collecting URIs of articles which give practical examples of using such systems? I'm thinking of one-template-per-article style, so we can actually learn how to use them, rather than a list of features. Cheers Ron Savage [EMAIL PROTECTED] http://savage.net.au/index.html
cgi and mod_perl config question
A client's webserver appears to have both mod_perl and cgi configured for a single machine. The httpd.conf file contains the following: Files *.cgi SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI /Files A little later in the file, this is found: AddHandler cgi-script .cgi Is the handler first defined used (mod_perl), or is mod_perl ignored, running the script as a standard cgi? Commenting out the cgi-script handler seems to have no effect, both in apache footprint or webserver performance, so I suspect that mod_perl is being used here. Am I correct in assuming this? This machine is running apache 1.3.20, with mod_perl 1.25 compiled statically (not a DSO). -- Wayne Earl [EMAIL PROTECTED] gpg key fingerprint: 3CE4 0558 635E DADB 327C 73AB 11CA 9A6B B209 E8C5
Re: cgi and mod_perl config question
On Mon, 9 Jul 2001, Wayne Earl wrote: A client's webserver appears to have both mod_perl and cgi configured for a single machine. The httpd.conf file contains the following: Files *.cgi SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI /Files A little later in the file, this is found: AddHandler cgi-script .cgi Is the handler first defined used (mod_perl), or is mod_perl ignored, running the script as a standard cgi? Commenting out the cgi-script handler seems to have no effect, both in apache footprint or webserver performance, so I suspect that mod_perl is being used here. Am I correct in assuming this? Since you don't provide the whole file it's hard to tell, since according to the manual the later setting should take over the previous setting: QUOTE AddHandler maps the filename extensions extension to the handler handler-name. This mapping is added to any already in force, overriding any mappings that already exist for the same extension. For example, to activate CGI scripts with the file extension .cgi, you might use: AddHandler cgi-script .cgi Once that has been put into your srm.conf or httpd.conf file, any file containing the .cgi extension will be treated as a CGI program. /QUOTE but this should answer all your questions: http://perl.apache.org/guide/install.html#How_can_I_tell_whether_mod_perl_ (skip the error log testing section) This machine is running apache 1.3.20, with mod_perl 1.25 compiled statically (not a DSO). -- Wayne Earl [EMAIL PROTECTED] gpg key fingerprint: 3CE4 0558 635E DADB 327C 73AB 11CA 9A6B B209 E8C5 _ Stas Bekman JAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
Re: PerlInitHandler and PerlSetEnv
this patch should fix the problem. you should also be able to s/PerlSetEnv/SetEnv/g, unless Embperl needs these variables before the fixup phase. Index: src/modules/perl/mod_perl.c === RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.c,v retrieving revision 1.140 diff -u -r1.140 mod_perl.c --- src/modules/perl/mod_perl.c 2001/06/19 03:12:44 1.140 +++ src/modules/perl/mod_perl.c 2001/07/10 03:19:27 @@ -1388,6 +1388,14 @@ cfg-setup_env = 0; /* just once per-request */ } +if (cfg-dir_env != cld-env) { +/* PerlSetEnv + * update only if the table changes across a request + */ +mod_perl_dir_env(r, cld); +cfg-dir_env = cld-env; +} + if(callbacks_this_request++ 0) return; if (!r-main) { @@ -1397,9 +1405,6 @@ */ (void)perl_request_rec(r); } - -/* PerlSetEnv */ -mod_perl_dir_env(r, cld); /* SetEnv PERL5LIB */ if (!MP_INCPUSH(cld)) { Index: src/modules/perl/mod_perl.h === RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.h,v retrieving revision 1.109 diff -u -r1.109 mod_perl.h --- src/modules/perl/mod_perl.h 2001/06/19 03:12:45 1.109 +++ src/modules/perl/mod_perl.h 2001/07/10 03:19:30 @@ -1064,6 +1064,7 @@ typedef struct { HV *pnotes; int setup_env; +table *dir_env; array_header *sigsave; } perl_request_config;
Re: announce: mod_perl-1.25_01
On Mon, 9 Jul 2001, Christian Gilmore wrote: Doug, I didn't see in the announcement that the below fix is included in 1.25_01. Can you please confirm? the patch has not been committed and will probably wait until after 1.26. i'm concerned that the current patch might introduce bugs elsewhere, its a thorny problem to solve and i don't want to delay 1.26 any longer.
Re: Accessing server config during parent startup
On Mon, 9 Jul 2001, Robin Berjon wrote: cfg = (axkit_dir_config *) ap_get_module_config(s-module_config, XS_AxKit); try s-lookup_defaults instead of s-module_config see also: modperl-2.0/src/modules/perl/modperl_pcw.c where you can see howto access all of the config apache has parsed. the same logic should work with 1.x, just need to s/apr_pool_t/pool/g and the like.
Re: RFC: Logging used Perl Modules (was Re: API Design Question)
On Tue, 3 Jul 2001, James G Smith wrote: The current code I have uses %INC, but I wanted to write something like the following: sub use : immediate { # do stuff here if logging return CORE::use(@_); } you could just override CORE::GLOBAL::require. you don't need to override the import, and your version of require will be called at the same time as the 'use'.
RE: modperl install without Apache src?
On Sun, 8 Jul 2001, Ged Haywood wrote: Hi there, On Fri, 6 Jul 2001, Knox, Laurie A, NPONS wrote: I read somewhere that there were potential problems when running mod_perl and PHP together in Apache, but I haven't been able to find that info again Is this an issue? I fear it is. Lots of people seem to run into trouble with that combination, I think Doug is looking at it again right now. i was looking into something related to directive handlers, and last time i looked, the problem was not specific to php. and of course, not a problem unless you're using directive handlers. the only other known problems i know of are: - older php's did not pickup largefile flags from apxs, which is fixed now if you use current 4.0.something - php ships with its own mysql client, if you're using DBD::mysql, you need to build php with configure --with-mysql=..., where ... is you system mysql directory.
Re: PerlInitHandler and PerlSetEnv
this patch should fix the problem. Yes, this fixes the problem :-) you should also be able to s/PerlSetEnv/SetEnv/g, unless Embperl needs these variables before the fixup phase. Embperl doesn't need them before the fixup phase, but sometimes you want different values for the environment variables for different directories, which doesn't work with SetEnv Thanks for the fast fix 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: PerlInitHandler and PerlSetEnv
On Tue, 10 Jul 2001, Gerald Richter wrote: Yes, this fixes the problem :-) cool. Embperl doesn't need them before the fixup phase, but sometimes you want different values for the environment variables for different directories, which doesn't work with SetEnv really? glancing at mod_env.c looks like it should work. Thanks for the fast fix would have been sooner but i was on an airplane the past 6 hours :)
Re: PerlInitHandler and PerlSetEnv
Embperl doesn't need them before the fixup phase, but sometimes you want different values for the environment variables for different directories, which doesn't work with SetEnv really? glancing at mod_env.c looks like it should work. The docs says: SetEnv directive Syntax: SetEnv variable value Context: server config, virtual host Status: Base Module: mod_env Compatibility: SetEnv is only available in Apache 1.1 and later. Sets an environment variable, which is then passed on to CGI scripts and SSI pages. Example: There is no directory, .htaccess in the context and that's like it really behaves. (unless they changed it in a very recent version and didn't update the docs, which I don't expect) PerlSetEnv is the only chance to have different values in different directories. Thanks for the fast fix would have been sooner but i was on an airplane the past 6 hours :) Then you are even faster :-) 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: The latest templating system: PSP in DDJ
I think that a templating system is the core component of a CMS (content management system). Probably the right direction (for a good TS) is an engine like Axkit. It support other templating system like ASP and Mason too. It need more documentation and more real world examples and more users (IMHO). The link XSP guide / Real World Example is still empty. The quick and dirty way for a CMS/Template System is not the best. I think we should also look at Java related project, learn the lesson and apply in Perl: Coocoon, Struct, JSP, EJB Take a look at www.caucho.com for a great job. Francesco - Original Message - From: Ron Savage [EMAIL PROTECTED] To: mod_perl [EMAIL PROTECTED] Sent: Tuesday, July 10, 2001 2:08 AM Subject: Re: The latest templating system: PSP in DDJ FWIW, Greg McCarroll is writing an article for perl.com on a short comparison of templating systems, and of course we'll have a talk on the subject at TPC by Perrin. Ahhh, 'short'. But that's another problem. I realize such articles are hard work, but (especially for those of us struggling to choose a templating system) is anybody collecting URIs of articles which give practical examples of using such systems? I'm thinking of one-template-per-article style, so we can actually learn how to use them, rather than a list of features. Cheers Ron Savage [EMAIL PROTECTED] http://savage.net.au/index.html
Re: ANNOUNCE: HTML::Embperl 2.0b3
Gerald Richter [EMAIL PROTECTED] wrote: The third beta of Embperl 2.0 is now available from ftp://ftp.dev.ecos.de/pub/perl/embperl/HTML-Embperl-2.0b3.tar.gz I got the following errors during make on Linux 2.2.12-20 (Red Hat 6.1):- /usr/bin/perl -I/usr/lib/perl5/5.00503/i386-linux -I/usr/lib/perl5/5.00503 -MExtUtils::MakeMaker -e MY-fixin(shift) blib/script/embpexec.pl Manifying blib/man3/HTML::Embperl::IntroD.3 /usr/bin/pod2man: Invalid man page - 1st pod line is not NAME in IntroD.pod Couldn't install blib/man3/HTML::Embperl::IntroD.3 Manifying blib/man3/HTML::Embperl::Syntax::RTF.3 /usr/bin/pod2man: Improper man page - no dash in NAME header in paragraph 67 of Embperl/Syntax/RTF.pm [ ... followed by many similar messages ...] Regards Paul Breslaw.
Re: ANNOUNCE: HTML::Embperl 2.0b3
/usr/bin/pod2man: Invalid man page - 1st pod line is not NAME in IntroD.pod Couldn't install blib/man3/HTML::Embperl::IntroD.3 That are only warnings about the docs, but perldoc foo for example perldoc HTML::Embperl::IntroD will still work. So nothing to worry about. I try to fix this in the next release 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: ASP.pm and script %main (name-table) !?
ivan wrote: hi, How can I access the current script name-table from module. I'm currently using : $main::XXX = 123; Then in the script : print $XXX; but this access the ASP %main not the script %main There is an Apache::ASP mailing list for discussing these things, which you can subscribe to at [EMAIL PROTECTED] ... Is there a way to access script main package and pull data there I'm working with ASP.pm-mod_perl If you defined globals in global.asa, or initialize in Script_OnStart, then it will be seen in your ASP scripts, otherwise in your ASP script you could access $XXX the same way you defined it: print $main::XXX --Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks - Web Link Checking Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
ASP.pm and multipart/form .. error
hi there , I encoutred a problem with ASP.pm (ver.2.17) and multipart form what is happening is that when I try to use file fields I get something like this into the log [Mon Jul 9 23:20:22 2001] [error] [client 192.168.0.5] Invalid method in request -7d11b8668d0668 [Mon Jul 9 23:20:41 2001] [error] [client 192.168.0.5] Invalid method in request -7d13c1268d0668 [Mon Jul 9 23:21:41 2001] [error] [client 192.168.0.2] Invalid method in request -7d17811a20 if the form is normal (w/o enctype=multipart/form-data ) I'm getting normally data into $Request.. nothing is crashing just I'm getting nothing into $Request collection... Additional info : CGI (3.2), Apache 1.3.20, mod_perl I think 1.25 i.e. www.apachetoolbox.com - ver 1.5.32 Can anyone confirm this !?! or tell me how can solve it ?! I'm continuing with the tests. :) = iVAN [EMAIL PROTECTED] =
Re: ASP.pm and multipart/form .. error
ivan wrote: hi there , I encoutred a problem with ASP.pm (ver.2.17) and multipart form what is happening is that when I try to use file fields I get something like this into the log [Mon Jul 9 23:20:22 2001] [error] [client 192.168.0.5] Invalid method in request -7d11b8668d0668 [Mon Jul 9 23:20:41 2001] [error] [client 192.168.0.5] Invalid method in request -7d13c1268d0668 [Mon Jul 9 23:21:41 2001] [error] [client 192.168.0.2] Invalid method in request -7d17811a20 if the form is normal (w/o enctype=multipart/form-data ) I'm getting normally data into $Request.. nothing is crashing just I'm getting nothing into $Request collection... Can you get the ./site/eg/file_upload.asp example working from the distribution? If so, see what's different about your script. I believe I'm running the same Apache + modperl now too, and I have never seen the problem you report, Apache 1.3.20, mod_perl 1.25 BTW, from the error, it doesn't look like it has to do with Apache::ASP. Maybe someone from the modperl list will give you some better info specific to modperl. -- Josh _ Joshua Chamas Chamas Enterprises Inc. NodeWorks Founder Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Apache::ASP book
Hello people: Is there a book anyone would recommend for apache::ASP programming, preferably something in the beginner section. thanx!
Re: announce: mod_perl-1.25_01
On Fri, 6 Jul 2001, Ken Williams wrote: [EMAIL PROTECTED] (Doug MacEachern) wrote: this is a 1.26 canidate, test reports most appreciated as always.. I just tested on Darwin (Mac OS X) with Apache 1.3.20 and using a simple 'perl Makefile.PL EVERYTHING=1' . All tests pass, with no warnings emitted during compilation. I think this is the first time that's happened for me on Darwin. =) great news!
ANNOUNCE: DBIx::Recordset 0.24
The URL ftp://ftp.dev.ecos.de/pub/perl/dbi/DBIx-Recordset-0.24.tar.gz has entered CPAN as file: $CPAN/authors/id/G/GR/GRICHTER/DBIx-Recordset-0.24.tar.gz size: 92611 bytes md5: 76835b342ac63d731a4eb9529613ee99 DBIx::Recordset is a perl module for abstraction and simplification of database access. The goal is to make standard database access (select/insert/update/delete) easier to handle and independend of the underlying DBMS. Special attention is made on web applications to make it possible to handle the state-less access and to process the posted data of formfields, but DBIx::Recordset is not limited to web applications. The main features of DBIx::Recordset are: - it has a compact interface, normaly only one function call is necessary for setup and data retrival/inseration/deletion - it takes care about type conversion and quoting - it is able to access/modify tables via arrays and hashs - it can automaticly create sub-objects for tables which are logical linked together - it can automatily create joins based on logical links - it has input/output filters on a per field/per type basis - it can create WHERE expression from a hash, which is especially usefull in a cgi environement, where you can simply pass all paramters posted to your cgi script to DBIx::Recordset and DBIx::Recordset creates an corresponding SELECT. - it can create previous/next buttons for html output - it works together with HTML::Embperl for easily genration of HTML output - it has an own database abtraction class DBIx::Compat which gives all the necessary information, so that DBIx::Recordset is able to work with different database systems - The class DBIx::Database is able to retrieve and store meta infomation of the database in a centralised location, which can be used for later setup. This is also usefull when running under mod_perl, because you can do all the setup and configuration work at webserver startup time, speeding up your scripts when a actual request is processed. DBIx::Recordset use the DBI API to access the database, so it should work with every database for which a DBD driver is available (see also DBIx::Compat) For more information look at perldoc DBIx::Recordset. An introduction to DBIx::Recordset can be view with perldoc Intrors.pod. The introduction can also be viewed online at http://perl.apache.org/embperl/Intrors.pod.cont.html DBIx::Recordset is tested with (but should also work with other DBMS) - DBD::mSQL - DBD::mysql - DBD::Pg - DBD::Solid - DBD::ODBC - DBD::Oracle - DBD::Sybase - DBD::CSV - DBD::Informix SYNOPSIS use DBIx::Recordset; # Setup a new object and select some recods... *set = DBIx::Recordset - Search ({'!DataSource' = 'dbi:Oracle:', '!Table' = 'users', '$where' = 'name = ? and age ?', '$values' = ['richter', 25] }) ; # Get the values of field foo ... print First Records value of foo is $set[0]{foo}\n ; print Second Records value of foo is $set[1]{foo}\n ; # Get the value of the field age of the current record ... print Age is $set{age}\n ; # Do another select with the already created object... $set - Search ({name = 'bar'}) ; # Show the result... print All users with name bar:\n ; while ($rec = $set - Next) { print $rec - {age} ; } # Setup another object and insert a new record *set2 = DBIx::Recordset - Insert ({'!DataSource' = 'dbi:Oracle:', '!Table' = 'users', 'name'= 'foo', 'age' = 25 }) ; # Update this record (change age from 25 to 99)... $set - Update ({age = 99}, {name = 'foo'}) ; Changes since 0.23: - Added Code to DBIx::Database to Create/Modify/Drop tables See CreateTables/DropTables - *fieldname can take an array ref, to specify different operators for multiple values which should compared to the same field. This is handy for selecting a range. - Filters are correctly apply if a arrayref with multiple value are passed to a SELECT. - Reset error code and string in DBIx::Database - new - If an array of values id passed in for one field and the operator is '=' now the IN sql operator is used, instead of a set of '='. - Set Postgres type 1005 to not numeric. Spotted by Michael Maruka. - Ignore errors in ListFields when retrieving metadata for a table. - Statement handle is closed as soon as possible, to avoid out of cursors situations. - new parameter $expr allow to group multiple sub expressions in a sql where, therefore allowing more complex conditions. - Added new parameter !MergeFunc which allow to specify a function that is called, when multiple records with the same key are found in a DBIx::Recordset::Hash object. - Added some code to handle table- and fieldnames which
cvs commit: modperl Changes
dougm 01/07/09 20:30:30 Modified:src/modules/perl mod_perl.c mod_perl.h .Changes Log: allow per-server and per-location PerlSetEnv to be properly merged when a per-server handler is configured Revision ChangesPath 1.141 +8 -3 modperl/src/modules/perl/mod_perl.c Index: mod_perl.c === RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.c,v retrieving revision 1.140 retrieving revision 1.141 diff -u -r1.140 -r1.141 --- mod_perl.c2001/06/19 03:12:44 1.140 +++ mod_perl.c2001/07/10 03:30:27 1.141 @@ -1388,6 +1388,14 @@ cfg-setup_env = 0; /* just once per-request */ } +if (cfg-dir_env != cld-env) { +/* PerlSetEnv + * update only if the table changes across a request + */ +mod_perl_dir_env(r, cld); +cfg-dir_env = cld-env; +} + if(callbacks_this_request++ 0) return; if (!r-main) { @@ -1397,9 +1405,6 @@ */ (void)perl_request_rec(r); } - -/* PerlSetEnv */ -mod_perl_dir_env(r, cld); /* SetEnv PERL5LIB */ if (!MP_INCPUSH(cld)) { 1.110 +1 -0 modperl/src/modules/perl/mod_perl.h Index: mod_perl.h === RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.h,v retrieving revision 1.109 retrieving revision 1.110 diff -u -r1.109 -r1.110 --- mod_perl.h2001/06/19 03:12:45 1.109 +++ mod_perl.h2001/07/10 03:30:28 1.110 @@ -1064,6 +1064,7 @@ typedef struct { HV *pnotes; int setup_env; +table *dir_env; array_header *sigsave; } perl_request_config; 1.611 +4 -0 modperl/Changes Index: Changes === RCS file: /home/cvs/modperl/Changes,v retrieving revision 1.610 retrieving revision 1.611 diff -u -r1.610 -r1.611 --- Changes 2001/07/09 15:03:07 1.610 +++ Changes 2001/07/10 03:30:29 1.611 @@ -10,6 +10,10 @@ =item 1.25_02-dev +allow per-server and per-location PerlSetEnv to be properly merged +when a per-server handler is configured, thanks to Michael Barry for +the spot + enabled Apache::ModuleConfig on win32 [Randy Kobes [EMAIL PROTECTED]]
RE: cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfigPerl.pm
On Mon, 9 Jul 2001, Geoffrey Young wrote: die in modperl_startup.pl if modperl_{inc,extra}.pl die anyway, I thought modperl_extra.pl was supposed to be optional? it is still optional, but if it exists and dies, then mod_perl should propagate that. although, the $@ !~ /^Can.t locate/ is bogus, because it might be that modperl_extra.pl was located, but a module it requires was not.
cvs commit: modperl-2.0/Apache-Test/lib/Apache TestConfigPerl.pm
dougm 01/07/09 09:04:48 Modified:Apache-Test/lib/Apache TestConfigPerl.pm Log: better check for existance of modperl_{inc,extra}.pl Revision ChangesPath 1.14 +1 -1 modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm Index: TestConfigPerl.pm === RCS file: /home/cvs/modperl-2.0/Apache-Test/lib/Apache/TestConfigPerl.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- TestConfigPerl.pm 2001/06/26 17:09:46 1.13 +++ TestConfigPerl.pm 2001/07/09 16:04:44 1.14 @@ -83,7 +83,7 @@ use lib '$serverroot'; for my \$file (qw(modperl_inc.pl modperl_extra.pl)) { eval { require conf/\$file } or -die if \$@ !~ /^Can.t locate/; +die if grep { -e \$_/conf/\$file } \@INC; } }
cvs commit: modperl-site/embperl index.html
richter 01/07/09 06:01:43 Modified:embperl index.html Log: Embperl website Revision ChangesPath 1.127 +13 -6 modperl-site/embperl/index.html Index: index.html === RCS file: /home/cvs/modperl-site/embperl/index.html,v retrieving revision 1.126 retrieving revision 1.127 diff -u -r1.126 -r1.127 --- index.html2001/07/09 05:59:25 1.126 +++ index.html2001/07/09 13:01:41 1.127 @@ -71,7 +71,7 @@ tr td bgcolor=#AFBDCAnbsp;Current Versionbr nbsp;a href=Embperl.pod.16.htmlcodeStable: 1.3.3/code/abr - nbsp;a href=Embperl.pod.16.htmlcodeBeta: nbsp;nbsp;2.0b2/code/abr + nbsp;a href=Embperl.pod.16.htmlcodeBeta: nbsp;nbsp;2.0b3/code/abr /tr tr td bgcolor=#00 align=centerbiga href=http://www.ecos.de/embperl/;img src=de.gif border=0/a/big/td @@ -131,12 +131,19 @@ tr td bgcolor=#bFcDdAbr ul type=square -lib29. Juni 2001/bbr - Embperl on conference tour: There is a talk on the +lib9. July 2001/bbr + Embperl 2.0b3 released. Includes many bugfixes which have greatly improved the usablility. + a href=ftp://ftp.dev.ecos.de/pub/perl/embperl/HTML-Embperl-2.0b3.tar.gz; + You can download it here/a +lib9. July 2001/bbr + bEmbperl on conference tour:/b There is a talk about Embperl on the a href=http://conferences.oreillynet.com/cs/os2001/pub/w/os2001/sessions_modperl.html;O'Reilly Open Source Software Convention/a - at July, 26. - If you prefer to come to europe you can visit the a href=http://apachecon.com/2001/EU/html/sessions.html;ApacheCon/A - on Oct, 15. in Dublin. Also I will be in Amsterdam at the YAPC and talk about mod_perl 2.0 + at bJuly, 26/b. + If you prefer to come to europe you can visit the + a href=http://apachecon.com/2001/EU/html/sessions.html;ApacheCon/A + on BOct, 15/b. in Dublin and hear me talking about Embperl. Also I will be in Amsterdam at the + a href=http://www.yapc.org/Europe/talks.html#33;YAPC and talk about mod_perl 2.0/a + on bAug, 3/b. lib6. Juni 2001/bbr Embperl 1.3.3 released. lib16. May 2001/bbr @@ -213,7 +220,7 @@ blockquote pfont color=#808080 size=1hr HTML::Embperl - Copyright (c) 1997-2001 Gerald Richter / ECOS lt;[EMAIL PROTECTED]gt; - Last Update $Id: index.html,v 1.126 2001/07/09 05:59:25 richter Exp $/font/p + Last Update $Id: index.html,v 1.127 2001/07/09 13:01:41 richter Exp $/font/p /blockquote /td/tr!--msnavigation--/table/body /html
cvs commit: modperl/apaci mod_perl.exp
dougm 01/07/09 08:03:29 Modified:.INSTALL.win32 Makefile.PL Changes lib/Apache src.pm src/modules/win32 mod_perl.def mod_perl.dsp t/conf httpd.conf-win32 t/modules src.t apacimod_perl.exp Log: enabled Apache::ModuleConfig on win32 win32 support for Apache::src Revision ChangesPath 1.8 +4 -0 modperl/INSTALL.win32 Index: INSTALL.win32 === RCS file: /home/cvs/modperl/INSTALL.win32,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- INSTALL.win32 2001/06/21 16:11:42 1.7 +++ INSTALL.win32 2001/07/09 15:03:05 1.8 @@ -151,6 +151,10 @@ will complete the installation. +This latter method of building mod_perl will also install the +Apache and mod_perl header files, which can then be accessed +through the Apache::src module. + =head1 CONFIGURATION Add this line to httpd.conf: 1.191 +45 -6 modperl/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl/Makefile.PL,v retrieving revision 1.190 retrieving revision 1.191 diff -u -r1.190 -r1.191 --- Makefile.PL 2001/07/06 20:08:27 1.190 +++ Makefile.PL 2001/07/09 15:03:06 1.191 @@ -354,7 +354,14 @@ $callback_hooks{$k} = $v if exists $callback_hooks{$k}; } -my $win32_auto = ($vcpp and $win32_args{APACHE_SRC}) ? 1 : 0; +my $win32_auto; +if ($vcpp and $win32_args{APACHE_SRC}) { + $EVERYTHING = 1; + my $fixed_apsrc = win32_fix_path($win32_args{APACHE_SRC}); + $APACHE_SRC = -d $fixed_apsrc/include ? +$fixed_apsrc : $fixed_apsrc . '/src'; + $win32_auto = 1; +} my %very_experimental = map {$_,1} qw(PERL_DEFAULT_OPMASK PERL_SAFE_STARTUP PERL_ORALL_OPMASK @@ -774,7 +781,9 @@ (need 1.2.0 or higher); } -for (qw(PERL_SECTIONS PERL_SSI), keys %experimental) { +$PERL_SECTIONS = $PERL_SSI = 0 if $Is_Win32; +unless ($Is_Win32) { + for (qw(PERL_SECTIONS PERL_SSI), keys %experimental) { $k = $_; if($experimental{$_}) { @@ -797,6 +806,7 @@ iedit $APACHE_SRC/modules/perl/Makefile, s/^($_) /#\$1 / if $$_; } + } } unless ($USE_APACI or $USE_APXS) { iedit $APACHE_SRC/modules/perl/Makefile, s/^#TRACE/TRACE/ if $PERL_TRACE; @@ -877,7 +887,7 @@ iedit $APACHE_SRC/modules/perl/Makefile, s/^#__ORIGINAL__/$edit_note/; } -if($mmn = 19970912 and not $USE_APACI and not $USE_APXS) { #1.3b1 +if($mmn = 19970912 and not $USE_APACI and not $USE_APXS and not $Is_Win32) { #1.3b1 system cat $APACHE_SRC/Makefile.config $APACHE_SRC/modules/perl/Makefile /tmp/mpmf.$$; system mv /tmp/mpmf.$$ $APACHE_SRC/modules/perl/Makefile; } @@ -887,7 +897,7 @@ \t, '$(CP) t/conf/mod_perl_srm.conf t/conf/srm.conf', \n; } unless ($USE_APXS) { - unless (-l t/httpd) { + unless (-l t/httpd or $Is_Win32) { system $Config{lns} $APACHE_SRC/httpd t/httpd; } write_extra_tests(); @@ -1088,6 +1098,10 @@ my $dummy = hooks=`$hooks'\n unless $hooks; cp lib/mod_perl_hooks.pm.PL, lib/mod_perl_hooks.pm; +if ($Is_Win32) { + my @args = ($^X, ' -spi.bak ', ' -e ', \s/sub mod_perl::hooks.*/sub mod_perl::hooks { qw($hooks) }/\, 'lib/mod_perl_hooks.pm'); + system(@args) == 0 or die @args failed\n; +} iedit lib/mod_perl_hooks.pm, qq(s/sub mod_perl::hooks.*/sub mod_perl::hooks { qw($hooks) }/); @@ -1099,7 +1113,7 @@ @list == @mod_perl_hooks or die Edit of lib/mod_perl_hooks.pm failed $!\n; } -unlink lib/mod_perl_hooks.pm~; +unlink $Is_Win32 ? lib/mod_perl_hooks.pm.bak : lib/mod_perl_hooks.pm~; } #checking for LWP code, borrowed from LWP's own Makefile.PL :-) @@ -1183,7 +1197,15 @@ } mkdir t/docs/subr, 0755; -system date t/docs/subr/index.html; +if ($Is_Win32) { + open FH, t/docs/subr/index.html + or die Cannot open t/docs/subr/index.html: $!; + print FH scalar(localtime); + close FH; +} +else { + system date t/docs/subr/index.html; +} return unless $callback_hooks{PERL_STACKED_HANDLERS} @@ -1524,6 +1546,18 @@ $My::self-{PM}-{$from} = $to; } +sub win32_mph { +return unless /\.h$/ or /os-inline\.c$/; +(my $d = $File::Find::dir) =~ s:^\Q$MODPERL_SRC::; +$d =~ s:^/::; +my $from = $File::Find::dir/$_; +my $to = '$(INST_ARCHLIB)/' . auto/Apache/include/modules/perl/; +$to .= $d/ if $d; +$to .= $_; + +$My::self-{PM}-{$from} = $to; +} + sub