Re: simple question
> > > > This might help, in you httpd.conf file set this > > >> > > >> PerlSendHeader Off > > >> > > >> Tor. > > >> > > >That messes up all the standard responses. I have a work around now > > >-- naturally it came to me moments after I posted > > > > > >don't know if this is "correct" so to speak, but it works fine. > > > > > > open(F,$file) || return 404; > > > $r->send_fd(F); > > > close F; > > > > > > pipe(R,W); > > > > > > > print W "some dynamically generated text\n"; > > > close W; > > > $r->send_fd(R); > > > close R; > > > > > > Won't this block after about 2048 bytes (on linux)? > > > > Yep, you are right... bummer! there must be a better way. Certainly > don't want to fork in Apache::mod_perl. Perhaps embedding the pipe > process in a loop and breaking the strings into blocks < 2048 would > be more efficient. If the darn headers could just be turned off it > would be a piece of cake. Like > > $r->send_cgi_header() >Take action on certain headers including Status:, >Location: and Content-type: just as mod_cgi does, then >calls $r->send_http_header(). Example of use: > > but without the call to $r-send_http_header() > what is the system overhead of something like this vs a fork sub pipe_write { my ($tp) = @_; my $len = length($$tp); my $off = 0; while (1) { my $ln = ($len-$off > 1024) ? 1024 : $len-$off; pipe(R,W); print W substr($$tp,$off,$ln); close W; $r->send_fd(R); close R; $off += $ln; last if $off >= $len; } } [EMAIL PROTECTED]
Re: simple question
> > > This might help, in you httpd.conf file set this > >> > >> PerlSendHeader Off > >> > >> Tor. > >> > >That messes up all the standard responses. I have a work around now > >-- naturally it came to me moments after I posted > > > >don't know if this is "correct" so to speak, but it works fine. > > > > open(F,$file) || return 404; > > $r->send_fd(F); > > close F; > > > > pipe(R,W); > > > > print W "some dynamically generated text\n"; > > close W; > > $r->send_fd(R); > > close R; > > > Won't this block after about 2048 bytes (on linux)? > Yep, you are right... bummer! there must be a better way. Certainly don't want to fork in Apache::mod_perl. Perhaps embedding the pipe process in a loop and breaking the strings into blocks < 2048 would be more efficient. If the darn headers could just be turned off it would be a piece of cake. Like $r->send_cgi_header() Take action on certain headers including Status:, Location: and Content-type: just as mod_cgi does, then calls $r->send_http_header(). Example of use: but without the call to $r-send_http_header() Michael [EMAIL PROTECTED]
Re: simple question
> > This might help, in you httpd.conf file set this >> >> PerlSendHeader Off >> >> Tor. >> >That messes up all the standard responses. I have a work around now >-- naturally it came to me moments after I posted > >don't know if this is "correct" so to speak, but it works fine. > > open(F,$file) || return 404; > $r->send_fd(F); > close F; > > pipe(R,W); > print W "some dynamically generated text\n"; > close W; > $r->send_fd(R); > close R; Won't this block after about 2048 bytes (on linux)? I thought pipe was only appropriate when forking was in use... pipe(R,W); if(fork) { print W "2048 or more bytes of text\n"; close W; } else { $r->send_fd(R); close R; } The reason for this was so that the write wouldn't block. In your example, there is nothing reading the data from the pipe, so once the buffer is full, writes will block until the data is read. I could be wrong Rob -- Rome didn't become great by having meetings; they did it by killing all those who opposed them.
Re: simple question
> This might help, in you httpd.conf file set this > > PerlSendHeader Off > > Tor. > That messes up all the standard responses. I have a work around now -- naturally it came to me moments after I posted don't know if this is "correct" so to speak, but it works fine. open(F,$file) || return 404; $r->send_fd(F); close F; pipe(R,W); print W "some dynamically generated text\n"; close W; $r->send_fd(R); close R; > Michael wrote: > > > when using mod perl to return plain text to the client how does one > > "send" without any headers in the response stream?? > > > > $r->send_fd(F) > > > > works fine for files, but how do you do it for dynamically generated > > content. > > > > Michael > > > > [EMAIL PROTECTED] >
Re: simple question
This might help, in you httpd.conf file set this PerlSendHeader Off Tor. Michael wrote: > when using mod perl to return plain text to the client how does one > "send" without any headers in the response stream?? > > $r->send_fd(F) > > works fine for files, but how do you do it for dynamically generated > content. > > Michael > > [EMAIL PROTECTED]
Re: simple question on installing and configuring
At 3:51 PM +0200 4/18/01, Emma Wermström (EMW) wrote: >Hi! > >I want to add mod_perl to my apache server. However, I already have >my server up and running and when I do: perl Makefile.PL I get a >request for my apache source directory. I don't know where it is >located so I just put: /usr/local/etc/apache. >Now the procedure continues but I get an error message that the >directory /modules/perl/mod_perl.c cannot be found in the >Makefile.PL line 2226. > >how do I go about solving these problems? I tried moving mod_perl >manually , but then I just get another error message. The guide is your friend http://perl.apache.org/guide/install.html http://perl.apache.org/guide/ >Do I have to write anything in the httpd.conf file? So far it has >added the mod_perl.c in LoadModule and AddModule automatically. >WHen I run the server I get an error message that it does not >recognize the command PerlHandler. Why not? > >Lots of questions! I'd be grateful for at least one answer. Thanks, > >Emma -- As soon as you make something foolproof, someone will create a better fool.
Re: simple question on installing and configuring
On Wed, 18 Apr 2001, [iso-8859-1] Emma Wermström (EMW) wrote: > Lots of questions! I'd be grateful for at least one answer. Thanks, Lots of answers: http://perl.apache.org/guide/ _ 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://logilune.com/ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
RE: Simple question about tables [OT]
Sounds like you want a union query... SELECT something, something_else FROM table1 UNION SELECT something, something_else FROM table2 I think some databases are pickier than others about each pair of fields being of the same datatype; Oracle requires each field to return the same number of fields, while I seem to recall MS Jet doesn't... For mismatched numbers of columns, do something like: SELECT something, '' FROM table1 UNION SELECT something, something_else FROM table2 If it's fussy about datatypes, using '', 0, null, sysdate, to_char() or similar things to match the datatypes of the corresponding fields should keep it happy... hth Rufus. -Original Message- From: bari [mailto:[EMAIL PROTECTED]] Sent: Monday, December 04, 2000 10:57 PM To: [EMAIL PROTECTED] Subject: Simple question about tables Hi there, I have two query's both have same # or rows as out put but have different columns. Like the first query gives me like 4 columns and the second query gives me 1 column as out put.. Now I want to club the results of both the queries so that the resulting table is 5 rows. I am able to display the result of each query in separate table.. Like I am able to display the result of first query which is 4 columns in one table. and the result of second query with one column as separate table. but I am not able to add the an extra column to first query so that it gives me an option to display result of the second query. it would be great if any one can help me. Thank You -bari - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Simple question: httpd (apache) vs httpd (mod_perl)
Keith Bradnam wrote: > > Hello, > > My understanding of perl is minimal, my understanding of mod_perl > non-existant but I have a (simple) question that I can't find anywhere > in the FAQ. Hopefully someone can help? > > I've just installed the apache web server (1.3.12) on our Tru64 Unix box. > One of the applications we run (via the web) suggests that you install > mod_perl to increase efficiency...so I did (version 1.24). > > I noticed that during the install mod_perl creates a new version of httpd > (in the src/ directory). How is this version different to the version > that apache creates? It's got the Perl interpreter embedded in it. Should I use the latter version in preference to > the apache version? > Yes, if you want to use mod_perl. You could also use the mod_perl module as a DSO, which might let you use your current httpd, but there have been some problems reported with that (may be solved, for all I know).
Re: Simple question: httpd (apache) vs httpd (mod_perl)
Hello Keith, We have a couple Alphas 4100 in the office with perl and mod_perl enabled Apache. The main difference is that the mod_perl httpd has the full perl embedded. That is, there is no need to load perl in order to execute cgi scripts written in perl. That is a big improvement in performance. Even more can be achieved by having the scripts remain (precompiled) in memory as part of the httpd son processes. On top of that your cgi scripts can interact at any stage of the Apache request handling process, which results in an incredibly powerfull/versatile server. In terms of being able to use the new httpd instead of the previous (Apache only) httpd, the answer is an absolute yes! Regards, Rafael Caceres At 09:36 AM 8/22/00 +0100, you wrote: >Hello, > >My understanding of perl is minimal, my understanding of mod_perl >non-existant but I have a (simple) question that I can't find anywhere >in the FAQ. Hopefully someone can help? > >I've just installed the apache web server (1.3.12) on our Tru64 Unix box. >One of the applications we run (via the web) suggests that you install >mod_perl to increase efficiency...so I did (version 1.24). > >I noticed that during the install mod_perl creates a new version of httpd >(in the src/ directory). How is this version different to the version >that apache creates? Should I use the latter version in preference to >the apache version? > >Thanks in advance, > >Keith > > >~ Keith Bradnam - Developer, Arabidopsis Genome Resource (AGR) >~ Nottingham Arabidopsis Stock Centre - http://nasc.nott.ac.uk/ >~ University Park, University of Nottingham, NG7 2RD, UK >~ Tel: (0115) 951 3091