RE: where to find info on the Apache request object
-Original Message- From: Sam Carleton [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 30, 2000 2:08 PM To: mod_perl Subject: Re: where to find info on the Apache request object Jeff Beard wrote: Or read chapter 9 in the Eagle book. --Jeff At 10:43 AM 4/30/00, Tobias Hoellrich wrote: At 01:34 PM 4/30/00 -0400, Sam Carleton wrote: I am learning perl/mod_perl right now and have some questions. I would like to see all the functions that I can call on the Apache request object. Can anyone point me to some documentation? I didn't see a listing in "Writing Apache Modules in Perl and C". Sam try 'perldoc Apache' Tobias and Jeff, Thanks for the pointer, but now I am looking for info on the Apache::Request object, I did not see it in Chapter 9 of the Eagle book. I tried a number of different ways of trying to get to it from perldoc, but failed. How do I go about bring up the doc on this in perldoc? Apache::Request is part of the libapreq package under the apache tree on CPAN: http://www.perl.com/CPAN-local/modules/by-module/Apache/libapreq-0.31.tar.gz install that, then 'perldoc Apache::Request' is all you need... HTH --Geoff Sam
PerlAddVar ?
It would be nice, in my opinion, to have some way of doing: PerlAddVar Fred "Value 1" PerlAddVar Fred "Value 2" And then in your script: my @values = $r-dir_config('Fred'); which gets ("Value 1","Value 2") in @values. Any thoughts on this? (I'm not set on the name PerlAddVar, if that's anyone's concern - but what about the idea of it?) -- Matt/ Fastnet Software Ltd. High Performance Web Specialists Providing mod_perl, XML, Sybase and Oracle solutions Email for training and consultancy availability. http://sergeant.org http://xml.sergeant.org
Re: PerlAddVar ?
It would be nice, in my opinion, to have some way of doing: PerlAddVar Fred "Value 1" PerlAddVar Fred "Value 2" And then in your script: my @values = $r-dir_config('Fred'); which gets ("Value 1","Value 2") in @values. Any thoughts on this? (I'm not set on the name PerlAddVar, if that's anyone's concern - but what about the idea of it?) That [the name] would be confusing. How about: PerlSetScalar Foo Bar PerlSetArray Foo A B C PerlPushArray Foo D PerlSetHash Foo key val __ Stas Bekman | JAm_pH--Just Another mod_perl Hacker http://stason.org/ | mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] | http://perl.orghttp://stason.org/TULARC/ http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org --
Re: PerlAddVar ?
On Mon, 1 May 2000, Stas Bekman wrote: It would be nice, in my opinion, to have some way of doing: PerlAddVar Fred "Value 1" PerlAddVar Fred "Value 2" And then in your script: my @values = $r-dir_config('Fred'); which gets ("Value 1","Value 2") in @values. Any thoughts on this? (I'm not set on the name PerlAddVar, if that's anyone's concern - but what about the idea of it?) That [the name] would be confusing. How about: PerlSetScalar Foo Bar PerlSetArray Foo A B C PerlPushArray Foo D PerlSetHash Foo key val Sounds cool to me. Naming things is still the hardest problem in Computer Science today... :-) -- Matt/ Fastnet Software Ltd. High Performance Web Specialists Providing mod_perl, XML, Sybase and Oracle solutions Email for training and consultancy availability. http://sergeant.org http://xml.sergeant.org
Re: PerlAddVar ?
It would be nice, in my opinion, to have some way of doing: PerlAddVar Fred "Value 1" PerlAddVar Fred "Value 2" And then in your script: my @values = $r-dir_config('Fred'); which gets ("Value 1","Value 2") in @values. Any thoughts on this? (I'm not set on the name PerlAddVar, if that's anyone's concern - but what about the idea of it?) That [the name] would be confusing. How about: PerlSetScalar Foo Bar PerlSetArray Foo A B C PerlPushArray Foo D PerlSetHash Foo key val Would it not be possible / preferable to handle this kind of thing from within Perl blocks? (localized to location, directory etc. blocks, even) At least, something along these lines would cut down on the amount of configuration syntax that would needed to be coped with. Cheers, Richard Richard Dice * Personal 514 816 9568 * Fax 514 816 9569 ShadNet Creator * http://shadnet.shad.ca/ * [EMAIL PROTECTED] Occasional Writer, HotWired * http://www.hotwired.com/webmonkey/ "squeeze the world 'til it's small enough to join us heel to toe" - jesus jones
Re: PerlAddVar ?
It would be nice, in my opinion, to have some way of doing: PerlAddVar Fred "Value 1" PerlAddVar Fred "Value 2" And then in your script: my @values = $r-dir_config('Fred'); which gets ("Value 1","Value 2") in @values. Any thoughts on this? (I'm not set on the name PerlAddVar, if that's anyone's concern - but what about the idea of it?) That [the name] would be confusing. How about: PerlSetScalar Foo Bar PerlSetArray Foo A B C PerlPushArray Foo D PerlSetHash Foo key val Would it not be possible / preferable to handle this kind of thing from within Perl blocks? (localized to location, directory etc. blocks, even) At least, something along these lines would cut down on the amount of configuration syntax that would needed to be coped with. Perl blocks get evaluated in the Apache::ReadConfig namespace, which knows nothing about location it's placed in. What you can do is to set FQDN variables from within Perl section: Perl $MyEnv::FOO = "bar" @MyEnv::FOO = qw(bar foo); %MyEnv::FOO{bar} = "barfoo"; /Perl It doesn't matter whether you define the package MyEnv or not, since it's autovivified when first time referenced to. and then in your code: print $MyEnv::FOO; will do. __ Stas Bekman | JAm_pH--Just Another mod_perl Hacker http://stason.org/ | mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] | http://perl.orghttp://stason.org/TULARC/ http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org --
Re: PerlAddVar ?
Perl blocks get evaluated in the Apache::ReadConfig namespace, which knows nothing about location it's placed in. What you can do is to set FQDN variables from within Perl section: Right... I didn't actually expect the perl block suggestion to be something that would work. I didn't know whether it would or not, actually. [Regardless, I wouldn't have known the reason why/why not, so your explanation was very helpful. :-) ] Still, I didn't feel out of place saying what I said because what was being discussed were the addition of new things to mod_perl, anyhow (e.g. PerlSetScalar, PerlSetArray, PerlPushArray, PerlSetHash). If we're talking about new stuff, then really, perhaps the way I suggested the new stuff could be included (via perl blocks, or local-perl, whatever, rather than a handful of new configuration directives) might be a good idea. Cheers, Richard Richard Dice * Personal 514 816 9568 * Fax 514 816 9569 ShadNet Creator * http://shadnet.shad.ca/ * [EMAIL PROTECTED] Occasional Writer, HotWired * http://www.hotwired.com/webmonkey/ "squeeze the world 'til it's small enough to join us heel to toe" - jesus jones
Re: PerlAddVar ?
On Mon, 1 May 2000, Stas Bekman wrote: Would it not be possible / preferable to handle this kind of thing from within Perl blocks? (localized to location, directory etc. blocks, even) At least, something along these lines would cut down on the amount of configuration syntax that would needed to be coped with. Perl blocks get evaluated in the Apache::ReadConfig namespace, which knows nothing about location it's placed in. What you can do is to set FQDN variables from within Perl section: Perl $MyEnv::FOO = "bar" @MyEnv::FOO = qw(bar foo); %MyEnv::FOO{bar} = "barfoo"; /Perl It doesn't matter whether you define the package MyEnv or not, since it's autovivified when first time referenced to. and then in your code: print $MyEnv::FOO; will do. The thing I don't like about this is that I'm writing code for non-perl programmers. Littering .htaccess files with perl code is not something I want to be getting into. I don't mind too much the work around that is: PerlSetVar MyVar "name = value, \ other = value, \ etc = continued" but I don't particularly think its well suited to setting multiple values for non-programmers, and it breaks as soon as you start needing spaces in values or something wierd that happens to break the parser code (from the Eagle book). -- Matt/ Fastnet Software Ltd. High Performance Web Specialists Providing mod_perl, XML, Sybase and Oracle solutions Email for training and consultancy availability. http://sergeant.org http://xml.sergeant.org
Re: PerlAddVar ?
On Mon, 1 May 2000, Richard Dice wrote: Perl blocks get evaluated in the Apache::ReadConfig namespace, which knows nothing about location it's placed in. What you can do is to set FQDN variables from within Perl section: Right... I didn't actually expect the perl block suggestion to be something that would work. I didn't know whether it would or not, actually. [Regardless, I wouldn't have known the reason why/why not, so your explanation was very helpful. :-) ] Still, I didn't feel out of place saying what I said because what was being discussed were the addition of new things to mod_perl, anyhow (e.g. PerlSetScalar, PerlSetArray, PerlPushArray, PerlSetHash). If we're talking about new stuff, then really, perhaps the way I suggested the new stuff could be included (via perl blocks, or local-perl, whatever, rather than a handful of new configuration directives) might be a good idea. For what its worth, I may just go ahead and start doing some XS code so that I can invent my own configuration directives. Its still an interesting discussion though - I wouldn't go as far as Stas, and add "PerlSetHash" (because they can easily be created from arrays), but PerlSetArray and PerlPushArray seem quite useful to me - although I don't think the name is quite right - if I'm doing stuff for non-programmers, the name "Array" means nothing to them, and "Push" means even less! ;-) -- Matt/ Fastnet Software Ltd. High Performance Web Specialists Providing mod_perl, XML, Sybase and Oracle solutions Email for training and consultancy availability. http://sergeant.org http://xml.sergeant.org
Strange mod_perl problem
I have several CGI scripts that I am in the process of moving to a new server using mod_perl and Apache. The scripts connect to an Oracle database using the Oraperl module wrapper for DBI and DBD::Oracle. Basically the scripts display a simple for for user input, this works fine. When the form is posted the script connects to a database, queries using the parameters provided, and returns a short report to the user. The scripts run fine as CGIs, but when I run them under mod_perl I'm not getting any output from the database after the form is posted. What's really strange is that I'm not getting any Oracle errors either. The return page has the proper HTML and BODY tags, but no data at all. I've tried running the script with and without the Apache::DBI module loaded, but it didn't make any difference. A check of the perl-status shows all the appropriate (I think) modules loaded for mob_perl. I'm stumped! Any help would be appreciated! Please CC replies to my email address. Thanks in advance! - Ralph Hughes mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] Systems Engineer 334-260-3200 Anteon Corp.DSN 596-5631 Montgomery, AL
Strange mod_perl output problem - Followup
OK, After further investigation, it seems that Oraperl/DBI/DBD, etc. are not at fault! I'm formatting the data for display using Perl formats and displaying it as pre-formatted output using pre/pre tags. This works great for CGI, but mod_perl seems to be having trouble with the write() calls to dump the data. Again, there are no errors, but no output either. Anyone have any experience with this?? Please CC replies to my email address. Thanks in advance! - I have several CGI scripts that I am in the process of moving to a new server using mod_perl and Apache. The scripts connect to an Oracle database using the Oraperl module wrapper for DBI and DBD::Oracle. - Lot's of erroneous stuff deleted --- - Ralph Hughes mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] Systems Engineer 334-260-3200 Anteon Corp.DSN 596-5631 Montgomery, AL
Re: modproxy:modperl ratios...
"GS" == Greg Stark [EMAIL PROTECTED] writes: GS 3) mod_proxy is poorly designed and poorly implemented. The main GSdeficiency is that each process is responsible for opening and GSmaintaining its connection to the backend. This defeats GSkeep-alives completely and forces a lot of overhead in the GSkernel and the servers. You don't want keepalives on for the back-end anyhow. Connections over the local loop should be fast enough.
RE: Strange mod_perl output problem - Followup
-Original Message- From: Hughes, Ralph [mailto:[EMAIL PROTECTED]] Sent: Monday, May 01, 2000 9:33 AM To: ModPerl Subject: Strange mod_perl output problem - Followup OK, After further investigation, it seems that Oraperl/DBI/DBD, eew... Oraperl is way outdated, and basically unsuppored by the community. Time to move to straight DBI/DBD... etc. are not at fault! I'm formatting the data for display using Perl formats and displaying it as pre-formatted output using pre/pre tags. This works great for CGI, but mod_perl seems to be having trouble with the write() calls to dump the data. do you have the same problem when moving to print()? I haven't seen any code on the list that calls write(), but mod_perl/apache does some tricky things with tie()ing STDOUT (which is way above me)... --Geoff Again, there are no errors, but no output either. Anyone have any experience with this?? Please CC replies to my email address. Thanks in advance! - I have several CGI scripts that I am in the process of moving to a new server using mod_perl and Apache. The scripts connect to an Oracle database using the Oraperl module wrapper for DBI and DBD::Oracle. - Lot's of erroneous stuff deleted --- - Ralph Hughes mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] Systems Engineer 334-260-3200 Anteon Corp.DSN 596-5631 Montgomery, AL
Is there are secret way to unsubscribe from this mailing list?
Could someone PLEASE remove me from this modperl mailing list? I've been sending email to `[EMAIL PROTECTED]' almost every day for the past week or two, but I still keep receiving email from this list. The mailing list documentation on http://perl.apache.org says to send email to the address above in order to unsubscribe. Furthermore, the following three headers get appended to every message in this list, which further supports the idea that I need to use of that particular email address for unsubscription requests: list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:[EMAIL PROTECTED] If no one is available/able to remove me from this list, perhaps there's something special and undocumented that I need to do in order to unsubscribe ... if so, could someone please let me know? Thanks in advance. -- Lloyd Zusman [EMAIL PROTECTED] perl -le '$n=170;for($d=2;($d*$d)=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0; $t++){$n=int($n/$d);}while($t--0){push(@r,$d);}}if($n1){push(@r,$n);} $x=0;map{$x+=(($_0)?(1log($_-0.5)/log(2.0)+1):1)}@r;print $x'
Re: Is there are secret way to unsubscribe from this mailing list?
Could someone PLEASE remove me from this modperl mailing list? I've been sending email to `[EMAIL PROTECTED]' almost every day for the past week or two, but I still keep receiving email from this list. The mailing list documentation on http://perl.apache.org says to send email to the address above in order to unsubscribe. Furthermore, the following three headers get appended to every message in this list, which further supports the idea that I need to use of that particular email address for unsubscription requests: list-help: mailto:[EMAIL PROTECTED] list-unsubscribe: mailto:[EMAIL PROTECTED] list-post: mailto:[EMAIL PROTECTED] If no one is available/able to remove me from this list, perhaps there's something special and undocumented that I need to do in order to unsubscribe ... if so, could someone please let me know? It's probably because you are subscribed by the address different from the one you send the unsubscribe request from. If you read the reponse that you get when you send to [EMAIL PROTECTED], you will see how to unsubscribe from the mail account different from the one listed in the mod_perl list db. Hope this helps. Thanks in advance. -- Lloyd Zusman [EMAIL PROTECTED] perl -le '$n=170;for($d=2;($d*$d)=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0; $t++){$n=int($n/$d);}while($t--0){push(@r,$d);}}if($n1){push(@r,$n);} $x=0;map{$x+=(($_0)?(1log($_-0.5)/log(2.0)+1):1)}@r;print $x' __ Stas Bekman | JAm_pH--Just Another mod_perl Hacker http://stason.org/ | mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] | http://perl.orghttp://stason.org/TULARC/ http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org --
Re: Is there are secret way to unsubscribe from this mailing list?
Lloyd Zusman [EMAIL PROTECTED] writes: I've been sending email to `[EMAIL PROTECTED]' almost every day for the past week or two, but I still keep receiving email from this list. The list is run using ezmlm. Sending mail to modperl-unsubscribe is just the first step in the process. You should receive a reply from the list server containing a pseudo-random key. Return the key to the list server and you will be off the list. This process prevents forged unsubscription by third parties. The initial answer you get from the unsubscribe address may also say "you are not on the list". That means that the address you sent the mail from is not on the list. The address through which list mail is reaching you is encoded in the return-path of each mail you receive from the list. That is the address that you need to use when unsubscribing. -- Frank Cringle, [EMAIL PROTECTED] voice: (+49 2304) 467101; fax: 943357
Re: Is there are secret way to unsubscribe from this mailing list?
[EMAIL PROTECTED] (Frank D. Cringle) writes: Lloyd Zusman [EMAIL PROTECTED] writes: I've been sending email to `[EMAIL PROTECTED]' almost every day for the past week or two, but I still keep receiving email from this list. The list is run using ezmlm. Sending mail to modperl-unsubscribe is just the first step in the process. You should receive a reply from the list server containing a pseudo-random key. Return the key to the list server and you will be off the list. This process prevents forged unsubscription by third parties. I understand how this process works. However, the problem is that I received nothing in return from any of the 6-10 unsubscribe messages I sent to that address over the past week or two. I also received nothing in return when I sent email to `[EMAIL PROTECTED]'. And yet, I keep receiving these messages from the mailing list, so my email address must be valid ... :) I sent the requests to `[EMAIL PROTECTED]' and also to `[EMAIL PROTECTED]' from the same address to which these mailing list emails are arriving, which is indeed the address I used when subscribing to the mailing list: `[EMAIL PROTECTED]'. The initial answer you get from the unsubscribe address may also say "you are not on the list". That means that the address you sent the mail from is not on the list. The address through which list mail is reaching you is encoded in the return-path of each mail you receive from the list. That is the address that you need to use when unsubscribing. Yep ... I understand all this, and I have sucessfully done it many times before with other mailing lists to which I've been subscribed. The problem seems to be that I'm not receiving the initial replies with the pseudo-random key. Has anyone actually gotten these `modperl-unsubscribe' or `modperl-help' addresses to work successfully within the past week or two? -- Lloyd Zusman [EMAIL PROTECTED] perl -le '$n=170;for($d=2;($d*$d)=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0; $t++){$n=int($n/$d);}while($t--0){push(@r,$d);}}if($n1){push(@r,$n);} $x=0;map{$x+=(($_0)?(1log($_-0.5)/log(2.0)+1):1)}@r;print $x'
Re: Is there are secret way to unsubscribe from this mailing list?
On 1 May 2000, Lloyd Zusman wrote: [EMAIL PROTECTED] (Frank D. Cringle) writes: Lloyd Zusman [EMAIL PROTECTED] writes: I've been sending email to `[EMAIL PROTECTED]' almost every day for the past week or two, but I still keep receiving email from this list. The list is run using ezmlm. Sending mail to modperl-unsubscribe is just the first step in the process. You should receive a reply from the list server containing a pseudo-random key. Return the key to the list server and you will be off the list. This process prevents forged unsubscription by third parties. I understand how this process works. However, the problem is that I received nothing in return from any of the 6-10 unsubscribe messages I sent to that address over the past week or two. I also received nothing in return when I sent email to `[EMAIL PROTECTED]'. And yet, I keep receiving these messages from the mailing list, so my email address must be valid ... :) I sent the requests to `[EMAIL PROTECTED]' and also to `[EMAIL PROTECTED]' from the same address to which these mailing list emails are arriving, which is indeed the address I used when subscribing to the mailing list: `[EMAIL PROTECTED]'. The initial answer you get from the unsubscribe address may also say "you are not on the list". That means that the address you sent the mail from is not on the list. The address through which list mail is reaching you is encoded in the return-path of each mail you receive from the list. That is the address that you need to use when unsubscribing. Yep ... I understand all this, and I have sucessfully done it many times before with other mailing lists to which I've been subscribed. The problem seems to be that I'm not receiving the initial replies with the pseudo-random key. Has anyone actually gotten these `modperl-unsubscribe' or `modperl-help' addresses to work successfully within the past week or two? Heh, isn't that like saying "Raise your hand, anyone who is not present" ? :) -- Lloyd Zusman [EMAIL PROTECTED] perl -le '$n=170;for($d=2;($d*$d)=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0; $t++){$n=int($n/$d);}while($t--0){push(@r,$d);}}if($n1){push(@r,$n);} $x=0;map{$x+=(($_0)?(1log($_-0.5)/log(2.0)+1):1)}@r;print $x' - nick
Apache::Registry and clearing package name space
Hello, I am having a problem clearing variables and aliases in a temporary package name space. The source of the problem is in making legend cgi scripts work under Apache::Registry. But the problem can be isolated and shown by the following demo program: $ cat foo.cgi #!/usr/bin/perl -w use strict; use Symbol qw(delete_package); print "Content-type: text/plain\n\n"; %Q::userdata=(); $Q::userdata{first_name}='first_name'; $Q::userdata{last_name}='last_name'; *Q::hello=\hello; print "here is the symbol table\n"; while (my($k,$v)=each %Q::) { print "$k = $v\n"; } delete_package('Q'); sub hello { print "hi\n"; } The first time it runs, it yields: here is the symbol table userdata = *Q::userdata hello = *Q::hello But there after, modperl shows emtpy symbol table. In my actual implementation, delete_package is used inside a PerlCleanupHandler. But the behavior is the same: the symbol table is completely gone even if I reinitialize the variables and aliases at the start again. Does anyone know a way around this? In perlfaq7 another method using scrub_package is mentioned. But that one is not appropriate because if a subroutine is aliased, that scrub_package will make the original subroutine undefined, causing havoc all over the place. Thanks for any info. Richard
Re: Strange mod_perl output problem - Followup
On Mon, 1 May 2000, Hughes, Ralph wrote: OK, After further investigation, it seems that Oraperl/DBI/DBD, etc. are not at fault! I'm formatting the data for display using Perl formats and displaying it as pre-formatted output using pre/pre tags. http://perl.apache.org/guide/porting.html#Using_format_and_write_ This works great for CGI, but mod_perl seems to be having trouble with the write() calls to dump the data. Again, there are no errors, but no output either. Anyone have any experience with this?? Please CC replies to my email address. Thanks in advance! - I have several CGI scripts that I am in the process of moving to a new server using mod_perl and Apache. The scripts connect to an Oracle database using the Oraperl module wrapper for DBI and DBD::Oracle. - Lot's of erroneous stuff deleted --- - Ralph Hughes mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] Systems Engineer 334-260-3200 Anteon Corp.DSN 596-5631 Montgomery, AL __ Stas Bekman | JAm_pH--Just Another mod_perl Hacker http://stason.org/ | mod_perl Guide http://perl.apache.org/guide mailto:[EMAIL PROTECTED] | http://perl.orghttp://stason.org/TULARC/ http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org --
2 server setup w/mod_proxy with a per-filename filter
hi, I'm trying to implement a one light + one fat apache server setup and I'm stumbling with the lack of an option to proxy-pass based on filename. It seems that mod_proxy is designed to handle complete hostnames and directories, and I'm wanting it to proxy everything that looks ~ \.pl$ The only workaround I foresee might be using mod_rewrite, but I'd rather not :), does anyone have a better idea? Or maybe a few examples of mod_rewrite use that work in this case? Of course, the reason of my woes is that I started designing with only one 'fat' httpd, and my websites have *.pl and *.ehtml files (for Registry scripts and Embperl files) intermingled within the directory structure, not separated. And redesigning a dozen websites is not practical right now :( martin -- -- To understand recursion, one must first understand recursion. -- -- - Martin Langhoff @ S C I M Multimedia Technology - - http://www.scim.net | God is real until - - mailto:[EMAIL PROTECTED] | declared integer -
Re: 2 server setup w/mod_proxy with a per-filename filter
"MAL" == Martin A Langhoff [EMAIL PROTECTED] writes: MAL The only workaround I foresee might be using mod_rewrite, but I'd MAL rather not :), does anyone have a better idea? Or maybe a few examples MAL of mod_rewrite use that work in this case? Why not? It really is your only option here. What I do is explicitly handle most types locally on the front end, then pass along anything else to the backend. This works since I control all content and file names. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vivek Khera, Ph.D.Khera Communications, Inc. Internet: [EMAIL PROTECTED] Rockville, MD +1-301-545-6996 GPG MIME spoken herehttp://www.khera.org/~vivek/
Re: Strange mod_perl output problem - Followup
On Mon, 1 May 2000, Stas Bekman wrote: On Mon, 1 May 2000, Hughes, Ralph wrote: OK, After further investigation, it seems that Oraperl/DBI/DBD, etc. are not at fault! I'm formatting the data for display using Perl formats and displaying it as pre-formatted output using pre/pre tags. http://perl.apache.org/guide/porting.html#Using_format_and_write_ Ah so that's why I couldn't get it to work!!! I was trying to solve this yesterday, and was completely bamboozled why even the $^A and formline implementation didn't work (although I might have been doing something wrong). Anyway, the solution I came up with was just sprintf: ##.## becomes %2.2f .## becomes %4.2f Pad all strings with (" " x 80) before using, and set their length with: %.25s for a max 25 char string. Or prefix the string with (" " x 80) for right-justifying. Works like a charm. -- Matt/ Fastnet Software Ltd. High Performance Web Specialists Providing mod_perl, XML, Sybase and Oracle solutions Email for training and consultancy availability. http://sergeant.org http://xml.sergeant.org
Re: Is there are secret way to unsubscribe from this mailing list?
On 1 May 2000, Lloyd Zusman wrote: [...] Yep ... I understand all this, and I have sucessfully done it many times before with other mailing lists to which I've been subscribed. From the qmail log files I can't see any attempts from you. I only have logs from the last 2-3 days though. The problem seems to be that I'm not receiving the initial replies with the pseudo-random key. Has anyone actually gotten these `modperl-unsubscribe' or `modperl-help' addresses to work successfully within the past week or two? More than a hundred people have successfully subscribed or unsubscribed in the past two weeks. I will unsubscribe you manually. - ask -- ask bjoern hansen - http://www.netcetera.dk/~ask/ more than 70M impressions per day, http://valueclick.com
Bitten by -D_FILE_OFFSET_BITS=64
Hello, (This may be a general Perl question but since I have this problem only with mod_perl I'm asking it here.) Perl's (5.6.0) Configure script puts -D_FILE_OFFSET_BITS=64 into Config.pm's variable ccflags in my machine (redhat 6.1 with linux 2.2.12). This causes for some reason mod_perl.c to have stat structure with size 96 while it has the size 88 in apache (and it is 88 usually). The result is very poor behavior in make test. When I manually remove that compiler directive everything works fine. My mod_perl is 1.23 and apache is 1.3.12. I believe I've had this problem for long since over the years :-) I've had this same problem occasionally but only now investigated it thoroughly using gdb. Can anybody give an explanation what is going on here? The member finfo has the type struct stat in request_rec in httpd.h. Regards, Ari Jolma
Re: 2 server setup w/mod_proxy with a per-filename filter
On Mon, May 01, 2000 at 01:31:26PM -0300, Martin A. Langhoff wrote: The only workaround I foresee might be using mod_rewrite, but I'd rather not :), does anyone have a better idea? Or maybe a few examples of mod_rewrite use that work in this case? mod_rewrite is quite nice for such a setup - I usually end up with a mix of proxy and rewrite to get the job done. Lots of examples are available in http://www.apache.org/docs/misc/rewriteguide.html vh Mads Toftum -- `Darn it, who spiked my coffee with water?!' - lwall
mod_perl httpd binary suddenly stops working
Hello, I have a mod_perl/apache binary and configuration file that I've been using successfully since October of last year. Last week I ran out of disk space (and might possibly have had the server flake out over the CPU overheating). Everything appears to be running smoothly now with a larger fan and more disk space, except the original httpd binary and config file I had refuse to start - it simply exits without any error messages or log entries and without daemonizing and spawning the necessary httpd children. httpd does not show up in the process list at all. I've tried to recompile httpd, but I keep getting segfaults when I try to use any mod_perl programs, and I was hoping that instead of troubleshooting a new compilation that perhaps it might be easier to resolve the once-working one. Are there any kinds of tracing tools or debugging tools that might help me figure out why the old httpd suddenly is having problems? --James
sticky variables...
first time post here :) I'm having a problem with some varibles changing mid-way thru the code and then back again. I have a program called 'cr' in the mod_perl directory. It's not a module, it's just a straight cgi script. It uses strict. Here's a samepl of the code: my ($cookie_ref,$sid,$cid) = check_oven_for_cookies($realsid); print "sid before call: $sid\n"; show_form; print "sid after call: $sid\n"; here's the sub (which resides inside of 'cr'): sub show_form { print "inside function: $sid\n"; other stuff } This 'cr' program gets hit about 5 times a second at peak times. About 10% of the time when I just keep hitting "reload" on the browser, occasionally the $sid will be DIFFERENT inside the function. actually it changes to someone elses $sid that is presumably running the program at the same time. But the $sid is always my personal $sid before and after the function. that's consistant. it's just when I make the function call that seemingly at random I get someone else's $sid! Any ideas? Would it fix things if I converted cr to a module and stuck all the functions into Cr.pm and just had cr calling the functions, passing $sid around instead?? I changed all my exit's to Apache::exit recently but that didn't fix it. I checked for nested subs, but I don't have any. Any help would be appreciated, :) thanks. -andrew-
RE: sticky variables...
see http://perl.apache.org/guide/porting.html#Exposing_Apache_Registry_secret and http://perl.apache.org/guide/porting.html#Sometimes_it_Works_Sometimes_it HTH --Geoff -Original Message- From: Andrew Dubry [mailto:[EMAIL PROTECTED]] Sent: Monday, May 01, 2000 2:35 PM To: [EMAIL PROTECTED] Subject: sticky variables... first time post here :) I'm having a problem with some varibles changing mid-way thru the code and then back again. I have a program called 'cr' in the mod_perl directory. It's not a module, it's just a straight cgi script. It uses strict. Here's a samepl of the code: my ($cookie_ref,$sid,$cid) = check_oven_for_cookies($realsid); print "sid before call: $sid\n"; show_form; print "sid after call: $sid\n"; here's the sub (which resides inside of 'cr'): sub show_form { print "inside function: $sid\n"; .other stuff } This 'cr' program gets hit about 5 times a second at peak times. About 10% of the time when I just keep hitting "reload" on the browser, occasionally the $sid will be DIFFERENT inside the function. actually it changes to someone elses $sid that is presumably running the program at the same time. But the $sid is always my personal $sid before and after the function. that's consistant. it's just when I make the function call that seemingly at random I get someone else's $sid! Any ideas? Would it fix things if I converted cr to a module and stuck all the functions into Cr.pm and just had cr calling the functions, passing $sid around instead?? I changed all my exit's to Apache::exit recently but that didn't fix it. I checked for nested subs, but I don't have any. Any help would be appreciated, :) thanks. -andrew-
Re: environment
On Mon, 1 May 2000, Thomas Glass wrote: Hi everyone,I'm having a problem and I wonder if you guys couldhelp me out: I have a script whose behaviour depends on the main path environment variable (and a cookie). The problem is that after a couple of reloads, the environment variables seem to get cached and the result comes out -obviously- wrong. I guess my question is: Is there any way to ensure that the script will get the right environment variables? maybe something in the apache configuration file? i don't like to rely on %ENV in a mod_perl environment. there are just so many better ways of doing this using the Apache API we havebut: http://perl.apache.org/guide/control.html#Wrapper_to_Emulate_the_Server_En i'd recommend doing things w/PerlSetVar and such: http://perl.apache.org/guide/config.html#PerlSetVar_PerlSetEnv_and_PerlP ky
pod and EmbPerl
Does anyone know whether it is possible to pod-ify an EmbPerl document? When embedding pod directives in my EmbPerl pages and then running pod2html on them, the pod2html interpreter returns a blank page. thanks, Ed
RE: $r-get_handlers bug/oversight?
hi again... I'm having lots of problems with the get_handlers method... the following is reproducible for me under 1.22, 1.23 and the latest cvs using 1.3.12... --- #!/usr/bin/perl my $r = shift; my $list; my @array = qw('test' 'array'); $r-pnotes(TEST = \@array); $r-push_handlers(PerlLogHandler = sub { my $pnotes = $r-pnotes; foreach my $key (sort keys %$pnotes) { warn "this is the key $key"; }; }); #$list = $r-get_handlers('PerlLogHandler'); $r-send_http_header('text/plain'); foreach my $key (@$list) { print "$key\n"; } print "done!"; --- running as is prints the pnotes keys. uncommenting the get_handlers method gives: Attempt to free unreferenced scalar. and no other output, yet a code reference is visible in the browser... The other thing is that this only seems to be an issue for code references - if I push My::Logger instead of a subroutine, all is fine... Am I using push_handlers incorrectly, or is get_handlers mucked up (or can nobody reproduce this)? --Geoff On Tue, 25 Apr 2000, Geoffrey Young wrote: Hi all... I've noticed that get_handlers() will return the enabled handlers for a PerlPostReadRequestHandler, but not when it is specified as a PerlInitHandler (either by calling $r-get_handlers('PerlPostReadRequestHandler') or $r-get_handlers('PerlInitHandler'). It is the same with PerlHeaderParserHandler. An oversight? Also, I can't get anything for PerlCleanupHandlers, which kinda makes sense, since Cleanup isn't really a phase, per se (at least according to the book). Does it make sense to add this to get_handlers() as well? oversight. neither CleanupHandler nor InitHandlers is in the handler_table in Apache.xs. probably because those directives were added after get/set handlers was implemented, and the table was never updated. i'll see about fixing that.
RE: Bitten by -D_FILE_OFFSET_BITS=64
Sorry about the previous blank reply. This has been fixed in a post 1.23 patch. Change the line $PERL_EXTRA_CFLAGS = ""; to $PERL_EXTRA_CFLAGS = $] = 5.006 ? $Config{ccflags} : ""; and try again. -P -Original Message- From: Ari Jolma [mailto:[EMAIL PROTECTED]] Sent: Monday, May 01, 2000 1:36 PM To: [EMAIL PROTECTED] Subject: Bitten by -D_FILE_OFFSET_BITS=64 Hello, (This may be a general Perl question but since I have this problem only with mod_perl I'm asking it here.) Perl's (5.6.0) Configure script puts -D_FILE_OFFSET_BITS=64 into Config.pm's variable ccflags in my machine (redhat 6.1 with linux 2.2.12). This causes for some reason mod_perl.c to have stat structure with size 96 while it has the size 88 in apache (and it is 88 usually). The result is very poor behavior in make test. When I manually remove that compiler directive everything works fine. My mod_perl is 1.23 and apache is 1.3.12. I believe I've had this problem for long since over the years :-) I've had this same problem occasionally but only now investigated it thoroughly using gdb. Can anybody give an explanation what is going on here? The member finfo has the type struct stat in request_rec in httpd.h. Regards, Ari Jolma
Re: 2 server setup w/mod_proxy with a per-filename filter
On Mon, 1 May 2000, Martin A. Langhoff wrote: hi, I'm trying to implement a one light + one fat apache server setup and I'm .. wanting it to proxy everything that looks ~ \.pl$ See [EMAIL PROTECTED]">http://forum.swarthmore.edu/epigone/modperl/mimzhingleh/[EMAIL PROTECTED] for some mod_rewrite examples from a couple of weeks ago on this list. - Matt