Re: Apache::ASP
Darrell Collins wrote: Hi All, I am trying to use Apache::ASP with Apache::DBI and Mysql. When I do a select * from table name where id='var' some times i get the correct data other times i get old data then i hit the reload button i get the correct data. Depending on the extension used for asp scripts, sometimes a browser might think the page static html. Try $Response-{Expires} = $time , documented at http://www.nodeworks.com/asp/objects.html This could also be a common mod_perl type gotcha, where your variables are being saved and not cleared between script invocations. Check out the mod_perl guide for more info, at http://perl.apache.org/guide/ Try "use strict" with your code, to make sure you don't have any unwanted globals. -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Apache::ASP
Lauchlan, Thanks for following directions, but you were never supposed to see this error message, as it is only for web server debugging, and was for your webmaster's eyes only. You ended up posted a bug report to a web developer group not affiliated with University of Mississippi. If this problem persists, you should contact the site's webmaster. -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051 Lauchlan Fraser wrote: I received an error while submitting an online registration form for a conference at the University of Mississippi. Here's the output Errors Output Can't locate Mail/Sendmail.pm in @INC (@INC contains: /usr/local/apache/htdocs/news/may_2000_conference/second_announcement/. /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 . /usr/local/apache/ /usr/local/apache/lib/perl) at (eval 46) line 2. BEGIN failed--compilation aborted at (eval 46) line 2. , /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1046 Debug Output STARTING ASP HANDLER (v0.16) for file /usr/local/apache/htdocs/news/may_2000_conference/second_announcement/registration_thank_you.asp GlobalASA package Apache::ASP::Compiles::_usr_local_apache_htdocs_news_may_2000_conference_second_announcement___global_asa compiling global.asa Apache::ASP::Compiles::_usr_local_apache_htdocs_news_may_2000_conference_second_announcement___global_asa global.asa routines - opening lock file /usr/local/apache/htdocs/news/may_2000_conference/second_announcement/./.state/server/application.lock created $Application - opening lock file /usr/local/apache/htdocs/news/may_2000_conference/second_announcement/./.state/server/internal.lock SessionCookie - 6cc4346b79e5a631f92b9db893dcaf7b refreshing 6cc4346b79e5a631f92b9db893dcaf7b with timeout 942417830 session timed out, clearing opening lock file /usr/local/apache/htdocs/news/may_2000_conference/second_announcement/./.state/6c/6cc4346b79e5a631f92b9db893dcaf7b.lock Session_OnEnd - session: 6cc4346b79e5a631f92b9db893dcaf7b; compiled - state 6cc4346b79e5a631f92b9db893dcaf7b locks: 0, unlocks: 0 opening lock file /usr/local/apache/htdocs/news/may_2000_conference/second_announcement/./.state/6c/6cc4346b79e5a631f92b9db893dcaf7b.lock tieing session 6cc4346b79e5a631f92b9db893dcaf7b tied session - err_mesg: ; clearing starting session forcing groups cleanup testing internal time for cleanup groups group check 6c skipping delete self - id: 6cc4346b79e5a631f92b9db893dcaf7b; state 6c locks: 0, unlocks: 0 cleanup groups - deleted: 0; Application_OnEnd compiled - Application_OnStart compiled - Session_OnStart - session: 6cc4346b79e5a631f92b9db893dcaf7b; compiled - ASP object created - Application: Apache::ASP::Application=HASH(0x8377504); GlobalASA: Apache::ASP::GlobalASA=HASH(0x8578828); Internal: Apache::ASP::State=HASH(0x85439b4); Request: Apache::ASP::Request=HASH(0x8580f9c); Response: Apache::ASP::Response=HASH(0x8582c7c); Server: Apache::ASP::Server=HASH(0x8578804); Session: Apache::ASP::Session=HASH(0x84bc128); allow_application_state: 1; app_start: 0; basename: registration_thank_you.asp; buffering_on: 1; cgi_do_self: 0; cgi_headers: ; clean: 0; command_line: ; compile_error: ; compile_includes: ; cookie_path: /; debug: 2; debugs_output: ARRAY(0x8578930); dirname: /usr/local/apache/htdocs/news/may_2000_conference/second_announcement; errors: 0; errors_output: ARRAY(0x8563cec); filehandle: ; filename: /usr/local/apache/htdocs/news/may_2000_conference/second_announcement/registration_thank_you.asp; filter: 0; global: /usr/local/apache/htdocs/news/may_2000_conference/second_announcement/.; global_package: ; group_refresh: 3; groups_refresh: 3; id: _usr_local_apache_htdocs_news_may_2000_conference_second_announcement_registration_thank_you_aspINLINE; includes_dir: ; init_packages: ARRAY(0x8578a8c); mail_alert_period: 20; mail_alert_to: ; mail_errors_to: ; mail_host: ; mtime: 939937890; no_cache: ; no_headers: 0; no_session: 0; no_state: ; package: Apache::ASP::Compiles::_usr_local_apache_htdocs_news_may_2000_conference_second_announcement___global_asa; paranoid_session: 0; pod_comments: 1; r: Apache=SCALAR(0x8582c1c); remote_ip: 130.101.203.136; script_timeout: 90; secure_session: ; session_serialize: ; session_timeout: 30; soft_redirect: ; stat_inc: ; stat_inc_match: ; state_cache: ; state_db: SDBM_File; state_dir: /usr/local/apache/htdocs/news/may_2000_conference/second_announcement/./.state; state_manager: 10; ua: Mozilla/4.61 [en] (Win98; U); unique_packages: 0; parsing registration_thank_you.asp inlining include /usr/local/apache/htdocs/inc/top.inc inlining include /usr/local/apache/htdocs/inc/bottom.inc
Re: Apache::ASP
Dear ModPerl List, Sorry for this misplaced post. I'll be removing the once thought to be helpful email support hints for Apache::ASP from the end of the html debugging option, because of these cases where webmasters leave developer debugging turned on in production. -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051 Lauchlan Fraser wrote: I received an error while submitting an online registration form for a conference at the University of Mississippi. Here's the output Errors Output Can't locate Mail/Sendmail.pm in @INC (@INC contains: /usr/local/apache/htdocs/news/may_2000_conference/second_announcement/. /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503 /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005 . /usr/local/apache/ /usr/local/apache/lib/perl) at (eval 46) line 2. BEGIN failed--compilation aborted at (eval 46) line 2. , /usr/lib/perl5/site_perl/5.005/Apache/ASP.pm line 1046 Debug Output
Re: Ye Ol' Template System Thread
Sam Tregar wrote: The only question I'm really itching to answer is which template system is fastest? Maybe I should cook up a benchmark suite. I suppose the hardest part about that will be finding a set of templates/scripts that constitute roughly equal tasks. What do you all think? After all, what's a 4H without a bake-off? I would like to see some generic web app benchmarked across web app systems, but have not the energy to do it, as HelloWorld was more than enough to manage. Both Matt Gerald a few months back suggested they were going to put together a more realistic benchmark, but don't know where they are with it. Please feel free to submit a benchmark for it. Check out http://www.chamas.com/hello_world.html -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Ye Ol' Template System Thread
Both Matt Gerald a few months back suggested they were going to put together a more realistic benchmark, but don't know where they are with it. I have started with this job, but my time wasn't eounght to get it to an point where I can release it. There are so much other things I had to do first :-( Gerald
Re: Support of CR LF in a EBCDIC environment
Dear list readers - I'm working with the following environment: BS2000-Posix as O.S. Perl-5.005_54 Apache-1.3.9 Mod_perl-1.21 BS2000-Posix has the EBCDIC as character set, both Apache-1.3.9 and perl-5.005_54 are ported to support EBCDIC code. I installed Apache with mod_perl and tried the counter example of the mod_perl guide: This example would work only if you have PerlSendHeader set to 'On' in the config file. Is it On? May be this is not a problem "\r\n", if this is your case Generally "\n\n" is enough for most (all?) of the widely used browsers (clients), but to be complient with HTTP RFCs one has to use "\r\n\r\n". what do you get when you replace this mod_cgi'ish header sending with true mod_perl'ish: my $r = shift; $r-content_type('text/html'); $r-send_http_header; or simpler: my $r = shift; $r-send_http_header('text/html'); Does it work? #!/usr/local/bin/perl -w use strict; print "Content-type: text/html\r\n\r\n"; my $counter = 0; for (1..5) { increment_counter(); } sub increment_counter{ $counter++; print "Counter is equal to . $counter !BR\n"; } The result that I have is: HTTP/1.1 200 OK Date: Mon, 15 Nov 1999 09:36:57 GMT Server: Apache/1.3.9 (BS2000) mod_perl/1.21 ApacheJServ/1.0 Connection: close Content-Type: text/plain Counter is equal to . 1 !BR Counter is equal to . 2 !BR Counter is equal to . 3 !BR Counter is equal to . 4 !BR Counter is equal to . 5 !BR Connection closed by foreign host. The content-type is text/plain instead text/html, mod_perl loses this header probably due to EBCDIC conversion of the "\n" character. Trying with print "Content-type: text/html\r\n"; or with print "Content-type: text/html\r\r\n"; the content-type is text/html, as it should be. I looked the sources of mod_perl for some part where the mod_perl is preparing the headers from the output of perl5 and to pass them to the apache. I don't understand who is doing that. Can someone help me to find where the content-type header is lost. -- Ignasi Roca ___ Stas Bekman mailto:[EMAIL PROTECTED]www.singlesheaven.com/stas Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC www.apache.org www.perl.com == www.modperl.com || perl.apache.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
RE: Support of CR LF in a EBCDIC environment
I'm not familiar with EBCDIC, but in Perl \r and \n are platform dependent, you migh want to try the platform independent \015 (cr) and \012 (lf). [EMAIL PROTECTED] wrote: Dear list readers - I'm working with the following environment: BS2000-Posix as O.S. Perl-5.005_54 Apache-1.3.9 Mod_perl-1.21 BS2000-Posix has the EBCDIC as character set, both Apache-1.3.9 and perl-5.005_54 are ported to support EBCDIC code. I installed Apache with mod_perl and tried the counter example of the mod_perl guide: #!/usr/local/bin/perl -w use strict; print "Content-type: text/html\r\n\r\n"; my $counter = 0; for (1..5) { increment_counter(); } sub increment_counter{ $counter++; print "Counter is equal to . $counter !BR\n"; } The result that I have is: HTTP/1.1 200 OK Date: Mon, 15 Nov 1999 09:36:57 GMT Server: Apache/1.3.9 (BS2000) mod_perl/1.21 ApacheJServ/1.0 Connection: close Content-Type: text/plain Counter is equal to . 1 !BR Counter is equal to . 2 !BR Counter is equal to . 3 !BR Counter is equal to . 4 !BR Counter is equal to . 5 !BR Connection closed by foreign host. The content-type is text/plain instead text/html, mod_perl loses this header probably due to EBCDIC conversion of the "\n" character. Trying with print "Content-type: text/html\r\n"; or with print "Content-type: text/html\r\r\n"; the content-type is text/html, as it should be. I looked the sources of mod_perl for some part where the mod_perl is preparing the headers from the output of perl5 and to pass them to the apache. I don't understand who is doing that. Can someone help me to find where the content-type header is lost. -- Ignasi Roca
RE: Support of CR LF in a EBCDIC environment
Your proposal works. Then, how to solve "the problem with "\n\n" ? To be compatible It should also work. This example would work only if you have PerlSendHeader set to 'On' in the config file. Is it On? May be this is not a problem "\r\n", if this is your case Generally "\n\n" is enough for most (all?) of the widely used browsers (clients), but to be complient with HTTP RFCs one has to use "\r\n\r\n". what do you get when you replace this mod_cgi'ish header sending with true mod_perl'ish: my $r = shift; $r-content_type('text/html'); $r-send_http_header; or simpler: my $r = shift; $r-send_http_header('text/html'); Does it work? #!/usr/local/bin/perl -w use strict; print "Content-type: text/html\r\n\r\n"; my $counter = 0; for (1..5) { increment_counter(); } sub increment_counter{ $counter++; print "Counter is equal to . $counter !BR\n"; } The result that I have is: HTTP/1.1 200 OK Date: Mon, 15 Nov 1999 09:36:57 GMT Server: Apache/1.3.9 (BS2000) mod_perl/1.21 ApacheJServ/1.0 Connection: close Content-Type: text/plain Counter is equal to . 1 !BR Counter is equal to . 2 !BR Counter is equal to . 3 !BR Counter is equal to . 4 !BR Counter is equal to . 5 !BR Connection closed by foreign host. The content-type is text/plain instead text/html, mod_perl loses this header probably due to EBCDIC conversion of the "\n" character. Trying with print "Content-type: text/html\r\n"; or with print "Content-type: text/html\r\r\n"; the content-type is text/html, as it should be. I looked the sources of mod_perl for some part where the mod_perl is preparing the headers from the output of perl5 and to pass them to the apache. I don't understand who is doing that. Can someone help me to find where the content-type header is lost. -- Ignasi Roca ___ Stas Bekman mailto:[EMAIL PROTECTED] www.singlesheaven.com/stas Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC www.apache.org www.perl.com == www.modperl.com || perl.apache.org single o- + single o-+ = singlesheaven http://www.singlesheaven.com
RE: Support of CR LF in a EBCDIC environment
Your proposal works. which one did work for you: PerlSendHeader On or $r-send_http_header? Then, how to solve "the problem with "\n\n" ? To be compatible It should also work. This example would work only if you have PerlSendHeader set to 'On' in the config file. Is it On? May be this is not a problem "\r\n", if this is your case Generally "\n\n" is enough for most (all?) of the widely used browsers (clients), but to be complient with HTTP RFCs one has to use "\r\n\r\n". what do you get when you replace this mod_cgi'ish header sending with true mod_perl'ish: my $r = shift; $r-content_type('text/html'); $r-send_http_header; or simpler: my $r = shift; $r-send_http_header('text/html'); Does it work? #!/usr/local/bin/perl -w use strict; print "Content-type: text/html\r\n\r\n"; my $counter = 0; for (1..5) { increment_counter(); } sub increment_counter{ $counter++; print "Counter is equal to . $counter !BR\n"; } The result that I have is: HTTP/1.1 200 OK Date: Mon, 15 Nov 1999 09:36:57 GMT Server: Apache/1.3.9 (BS2000) mod_perl/1.21 ApacheJServ/1.0 Connection: close Content-Type: text/plain Counter is equal to . 1 !BR Counter is equal to . 2 !BR Counter is equal to . 3 !BR Counter is equal to . 4 !BR Counter is equal to . 5 !BR Connection closed by foreign host. The content-type is text/plain instead text/html, mod_perl loses this header probably due to EBCDIC conversion of the "\n" character. Trying with print "Content-type: text/html\r\n"; or with print "Content-type: text/html\r\r\n"; the content-type is text/html, as it should be. I looked the sources of mod_perl for some part where the mod_perl is preparing the headers from the output of perl5 and to pass them to the apache. I don't understand who is doing that. Can someone help me to find where the content-type header is lost. -- Ignasi Roca ___ Stas Bekman mailto:[EMAIL PROTECTED] www.singlesheaven.com/stas Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC www.apache.org www.perl.com == www.modperl.com || perl.apache.org single o- + single o-+ = singlesheaven http://www.singlesheaven.com ___ Stas Bekman mailto:[EMAIL PROTECTED]www.singlesheaven.com/stas Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC www.apache.org www.perl.com == www.modperl.com || perl.apache.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
RE: Support of CR LF in a EBCDIC environment
Your proposal works. which one did work for you: PerlSendHeader On or $r-send_http_header? In my first try with the print "Content-type: text/html\r\n\r\n" I had the "PerlSendHeader On" and the content-type of the response was "text/plain". In the second try with "$r-send_http_header" I removed the "PerlSendHeader On" and the content-type of the response is "text/html" Then, how to solve "the problem with "\n\n" ? To be compatible It should also work. This example would work only if you have PerlSendHeader set to 'On' in the config file. Is it On? May be this is not a problem "\r\n", if this is your case Generally "\n\n" is enough for most (all?) of the widely used browsers (clients), but to be complient with HTTP RFCs one has to use "\r\n\r\n". what do you get when you replace this mod_cgi'ish header sending with true mod_perl'ish: my $r = shift; $r-content_type('text/html'); $r-send_http_header; or simpler: my $r = shift; $r-send_http_header('text/html'); Does it work? #!/usr/local/bin/perl -w use strict; print "Content-type: text/html\r\n\r\n"; my $counter = 0; for (1..5) { increment_counter(); } sub increment_counter{ $counter++; print "Counter is equal to . $counter !BR\n"; } The result that I have is: HTTP/1.1 200 OK Date: Mon, 15 Nov 1999 09:36:57 GMT Server: Apache/1.3.9 (BS2000) mod_perl/1.21 ApacheJServ/1.0 Connection: close Content-Type: text/plain Counter is equal to . 1 !BR Counter is equal to . 2 !BR Counter is equal to . 3 !BR Counter is equal to . 4 !BR Counter is equal to . 5 !BR Connection closed by foreign host. The content-type is text/plain instead text/html, mod_perl loses this header probably due to EBCDIC conversion of the "\n" character. Trying with print "Content-type: text/html\r\n"; or with print "Content-type: text/html\r\r\n"; the content-type is text/html, as it should be. I looked the sources of mod_perl for some part where the mod_perl is preparing the headers from the output of perl5 and to pass them to the apache. I don't understand who is doing that. Can someone help me to find where the content-type header is lost. -- Ignasi Roca ___ Stas Bekman mailto:[EMAIL PROTECTED] www.singlesheaven.com/stas Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC www.apache.org www.perl.com == www.modperl.com || perl.apache.org single o- + single o-+ = singlesheaven http://www.singlesheaven.com ___ Stas Bekman mailto:[EMAIL PROTECTED]www.singlesheaven.com/stas Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC www.apache.org www.perl.com == www.modperl.com || perl.apache.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
Apache::Language Problem
Hi I tried to install Apache::Language with perl -MCPAN -eshell and install Apache::Langauge this dows not work ... the I tried to copy th *.h files form modperl and apache into place an it did not work either anny hints ?? Manon Goo PS: I am not on the [EMAIL PROTECTED] list please reply to [EMAIL PROTECTED] The following happend: lutz:/usr/src/CPAN/build/Apache-Language-0.07# make cc -c -I./auto/Apache/include -I./auto/Apache/include/modules/perl -I -Dbool=char -DHAS_BOOL -D_REENTRANT -DDEBIAN -I/usr/local/include -O2 -DVERSION=\"0.07\" -DXS_VERSION=\"0.07\" -fPIC -I/usr/lib/perl5/5.005/i386-linux/CORE Language.c Language.xs:1: modules/perl/mod_perl.h: No such file or directory make: *** [Language.o] Error 1 ## ## My Fix lutz:/usr/src/CPAN/build/Apache-Language-0.07# cp -a ../mod_perl-1.21/src/modules . lutz:/usr/src/CPAN/build/Apache-Language-0.07# cp -a /usr/include/apache-1.3/* modules/perl/ ## ## The Ugly Result lutz:/usr/src/CPAN/build/Apache-Language-0.07# make cc -c -I./auto/Apache/include -I./auto/Apache/include/modules/perl -I -Dbool=char -DHAS_BOOL -D_REENTRANT -DDEBIAN -I/usr/local/include -O2 -DVERSION=\"0.07\" -DXS_VERSION=\"0.07\" -fPIC -I/usr/lib/perl5/5.005/i386-linux/CORE Language.c In file included from /usr/lib/perl5/5.005/i386-linux/CORE/perl.h:1276, from modules/perl/mod_perl.h:41, from Language.xs:1: /usr/lib/perl5/5.005/i386-linux/CORE/cop.h:217: parse error before `bool' /usr/lib/perl5/5.005/i386-linux/CORE/cop.h:217: warning: no semicolon at end of struct or union /usr/lib/perl5/5.005/i386-linux/CORE/cop.h:218: warning: data definition has no type or storage class /usr/lib/perl5/5.005/i386-linux/CORE/cop.h:227: parse error before `}' /usr/lib/perl5/5.005/i386-linux/CORE/cop.h:268: field `cx_subst' has incomplete type In file included from /usr/lib/perl5/5.005/i386-linux/CORE/perl.h:1280, from modules/perl/mod_perl.h:41, from Language.xs:1: /usr/lib/perl5/5.005/i386-linux/CORE/scope.h:135: parse error before `bool' /usr/lib/perl5/5.005/i386-linux/CORE/scope.h:135: warning: no semicolon at end of struct or union In file included from /usr/lib/perl5/5.005/i386-linux/CORE/perl.h:2109, from modules/perl/mod_perl.h:41, from Language.xs:1: /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:27: parse error before `Perl_Gv_AMupdate' /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:27: warning: data definition has no type or storage class /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:33: parse error before `Perl_avhv_exists_ent' /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:33: warning: data definition has no type or storage class /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:98: parse error before `Perl_do_aexec' /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:98: warning: data definition has no type or storage class /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:101: parse error before `Perl_do_close' /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:101: parse error before `bool' /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:101: warning: data definition has no type or storage class /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:102: parse error before `Perl_do_eof' /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:102: warning: data definition has no type or storage class /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:103: parse error before `Perl_do_exec' /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:103: warning: data definition has no type or storage class /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:115: parse error before `Perl_do_open' /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:116: warning: data definition has no type or storage class /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:118: parse error before `Perl_do_print' /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:118: warning: data definition has no type or storage class /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:121: parse error before `Perl_do_seek' /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:121: warning: data definition has no type or storage class /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:149: parse error before `bool' /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:182: parse error before `Perl_hv_exists' /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:182: warning: data definition has no type or storage class /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:183: parse error before `Perl_hv_exists_ent' /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:183: warning: data definition has no type or storage class /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:204: parse error before `Perl_io_close' /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:204: warning: data definition has no type or storage class /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:522: parse error before `Perl_sv_2bool' /usr/lib/perl5/5.005/i386-linux/CORE/proto.h:522: warning: data definition has no type or storage class
Newline
Dear list readers - On Mon, 15 Nov 1999, Stas Bekman wrote: Generally "\n\n" is enough for most (all?) of the widely used browsers (clients), but to be compliant with HTTP RFCs one has to use "\r\n\r\n". I do not believe this to be true. I have had problems when sending "\n\n" to users with Micro$oft !nternet Expl0rer 4.0. When MSIE4 sees \n\n in a user response field in a FORM it screws up the box into which the user is supposed to type his response. To fix the problem I explicitly send "\r\n\r\n" and then all is OK. Kind regards, Ged Haywood. PS: Can anybody help with my posting of 3 November? I have seen no response.
RE: Support of CR LF in a EBCDIC environment
which one did work for you: PerlSendHeader On or $r-send_http_header? In my first try with the print "Content-type: text/html\r\n\r\n" I had the "PerlSendHeader On" and the content-type of the response was "text/plain". In the second try with "$r-send_http_header" I removed the "PerlSendHeader On" and the content-type of the response is "text/html" Which means that the problem lies in parsing the possible header from the scripts when "PerlSendHeader On", otherwise you don't have any problem with EBCDIC environment, as $r-send_http_header sends it correctly... Then, how to solve "the problem with "\n\n" ? To be compatible It should also work. This example would work only if you have PerlSendHeader set to 'On' in the config file. Is it On? May be this is not a problem "\r\n", if this is your case Generally "\n\n" is enough for most (all?) of the widely used browsers (clients), but to be complient with HTTP RFCs one has to use "\r\n\r\n". what do you get when you replace this mod_cgi'ish header sending with true mod_perl'ish: my $r = shift; $r-content_type('text/html'); $r-send_http_header; or simpler: my $r = shift; $r-send_http_header('text/html'); Does it work? #!/usr/local/bin/perl -w use strict; print "Content-type: text/html\r\n\r\n"; my $counter = 0; for (1..5) { increment_counter(); } sub increment_counter{ $counter++; print "Counter is equal to . $counter !BR\n"; } The result that I have is: HTTP/1.1 200 OK Date: Mon, 15 Nov 1999 09:36:57 GMT Server: Apache/1.3.9 (BS2000) mod_perl/1.21 ApacheJServ/1.0 Connection: close Content-Type: text/plain Counter is equal to . 1 !BR Counter is equal to . 2 !BR Counter is equal to . 3 !BR Counter is equal to . 4 !BR Counter is equal to . 5 !BR Connection closed by foreign host. The content-type is text/plain instead text/html, mod_perl loses this header probably due to EBCDIC conversion of the "\n" character. Trying with print "Content-type: text/html\r\n"; or with print "Content-type: text/html\r\r\n"; the content-type is text/html, as it should be. I looked the sources of mod_perl for some part where the mod_perl is preparing the headers from the output of perl5 and to pass them to the apache. I don't understand who is doing that. Can someone help me to find where the content-type header is lost. -- Ignasi Roca ___ Stas Bekman mailto:[EMAIL PROTECTED] www.singlesheaven.com/stas Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC www.apache.org www.perl.com == www.modperl.com || perl.apache.org single o- + single o-+ = singlesheaven http://www.singlesheaven.com ___ Stas Bekman mailto:[EMAIL PROTECTED]www.singlesheaven.com/stas Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC www.apache.org www.perl.com == www.modperl.com || perl.apache.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com ___ Stas Bekman mailto:[EMAIL PROTECTED]www.singlesheaven.com/stas Perl,CGI,Apache,Linux,Web,Java,PC at www.singlesheaven.com/stas/TULARC www.apache.org www.perl.com == www.modperl.com || perl.apache.org single o- + single o-+ = singlesheavenhttp://www.singlesheaven.com
Apache::ASP and SSI
Hi, I'd like to do server-side includes in my Apache::ASP file. How do I write my httpd.conf? I tried Location /perl/ AddHandler server-parsed .asp AddHandler perl-script .asp PerlHandler Apache::ASP /Location The ASP works fine, but the SSI does not happen. - Stefan Reitshamer [EMAIL PROTECTED]
Apache and FILEHANDLES
All, Is there another way to write to files than print OPF (END); ... END I've checked out the Eagle book and all I saw concerning this was tie(ing) FILEHANDLES to STDOUT/IN. Also, why can't I write to files from startup.pl (i.e. during server start up?!) If these are obvious, please don't shout. Somtimes the obvious is hard to see!! Ha! -Ants. __ Get Your Private, Free Email at http://www.hotmail.com
Re: Apache and FILEHANDLES
Try using anonymous file handles using the gensym function in the package Symbol; #!/usr/bin/perl -w use Symbol; my $fh = gensym; my $file = "bar"; open $fh, "${file}" or die; print $fh "foo\n"; close $fh; Is there another way to write to files than print OPF (END); ... END I've checked out the Eagle book and all I saw concerning this was tie(ing) FILEHANDLES to STDOUT/IN. Also, why can't I write to files from startup.pl (i.e. during server start up?!) If these are obvious, please don't shout. Somtimes the obvious is hard to see!! Ha! ... __... __ ... ... .. .. Renzo Toma http://www.veronica.nl Veronica Internet UNIX system engineer/admin ... _ .
Re: Apache and FILEHANDLES
Out of curiosity, what is wrong with the regular open/close/print END? The Apache::File class provides an Apache-oriented version of IO::File; it's described on pp 489-496 in my copy of the Eagle book. Depending on what files you want to write to, there might be other ways. If you are just using a temporary (scratch) file, you can use Apache::File::tmpfile, or if you are keeping a log, it might be easier to just use Apache::Log and then use something like the $r-log-warn("MY HANDLER = $my_particular_error_message"); syntax and keep all your messages in the error log. darren Anthony Gardner ([EMAIL PROTECTED]) wrote: All, Is there another way to write to files than print OPF (END); ... END I've checked out the Eagle book and all I saw concerning this was tie(ing) FILEHANDLES to STDOUT/IN. Also, why can't I write to files from startup.pl (i.e. during server start up?!) If these are obvious, please don't shout. Somtimes the obvious is hard to see!! Ha! -Ants.
[PATCH] Apache headers need to be changed for compiling mod_perl under ActivePerl
Hi, attached you find a patch that needs to be applied to the Apache sources for compiling mod_perl under ActivePerl. Doug, could you or someone else with a CVS acount to the Apache sources please apply this patch? AFAIK there's no functional difference between the patched headers and the current headers, so I can see no problems. I have additionally supplied this patch to the Apache bug tracking system. The PR# is unknown, as the query system seems to be down currently. Bye, Jochen *** http_config.h.jworigThu May 06 20:16:10 1999 --- http_config.h Mon Nov 15 18:33:20 1999 *** *** 325,332 API_EXPORT(void) ap_add_module(module *m); API_EXPORT(void) ap_remove_module(module *m); ! API_EXPORT(void) ap_add_loaded_module(module *mod); ! API_EXPORT(void) ap_remove_loaded_module(module *mod); API_EXPORT(int) ap_add_named_module(const char *name); API_EXPORT(void) ap_clear_module_list(void); API_EXPORT(const char *) ap_find_module_name(module *m); --- 325,332 API_EXPORT(void) ap_add_module(module *m); API_EXPORT(void) ap_remove_module(module *m); ! API_EXPORT(void) ap_add_loaded_module(module *); ! API_EXPORT(void) ap_remove_loaded_module(module *); API_EXPORT(int) ap_add_named_module(const char *name); API_EXPORT(void) ap_clear_module_list(void); API_EXPORT(const char *) ap_find_module_name(module *m); *** *** 361,367 void *ap_create_request_config(pool *p); CORE_EXPORT(void *) ap_create_per_dir_config(pool *p); ! void *ap_merge_per_dir_configs(pool *p, void *base, void *new); /* For http_core.c... (Directory command and virtual hosts) */ --- 361,367 void *ap_create_request_config(pool *p); CORE_EXPORT(void *) ap_create_per_dir_config(pool *p); ! void *ap_merge_per_dir_configs(pool *, void *, void *); /* For http_core.c... (Directory command and virtual hosts) */ *** *** 401,408 /* for mod_perl */ CORE_EXPORT(const command_rec *) ap_find_command(const char *name, const command_rec *cmds); ! CORE_EXPORT(const command_rec *) ap_find_command_in_modules(const char *cmd_name, module **mod); ! CORE_EXPORT(void *) ap_set_config_vectors(cmd_parms *parms, void *config, module *mod); CORE_EXPORT(const char *) ap_handle_command(cmd_parms *parms, void *config, const char *l); #endif --- 401,408 /* for mod_perl */ CORE_EXPORT(const command_rec *) ap_find_command(const char *name, const command_rec *cmds); ! CORE_EXPORT(const command_rec *) ap_find_command_in_modules(const char *, module **); ! CORE_EXPORT(void *) ap_set_config_vectors(cmd_parms *parms, void *, module *); CORE_EXPORT(const char *) ap_handle_command(cmd_parms *parms, void *config, const char *l); #endif
Re: Ye Ol' Template System Thread
On Mon, 15 Nov 1999, Leslie Mikesell wrote: What I'm looking for is a 'nestable' way of handling the logic flow and HTML construction that will allow a page to be used as a stand-alone item (perhaps displayed in a frameset) or included in another page, but when it is included I'd like to have the option of letting its execution return a status that the including page could see before it sends out any HTML. Ok, here's how you can do this with HTML::Template. I can't really address the solution as "pages that execute" since with HTML::Template, only scripts execute. But anyway: First, define your component that you want to use both stand-alone and as an included component: component.tmpl: TMPL_IF NAME="STAND_ALONE_MODE" HTML HEAD TITLEI'm all alone.../TITLE /HEAD BODY /TMPL_IF Some stuff that users will love to pay for : BR by the way, my name is TMPL_VAR NAME="NAME"P TMPL_IF NAME="STAND_ALONE_MODE" /BODY /HTML /TMPL_IF Now, when you want to use it stand-alone: stand_along.cgi: my $template = HTML::Template-new(filename = 'component.tmpl'); $template-param(STAND_ALONE_MODE = 1); $template-param(NAME = 'Sam'); print "Content-Type: text/html\n\n"; print $template-output; Or within a larger entity: larger.tmpl: HTML HEAD TITLEThis is a big ol' page/TITLE /HEAD BODY Some stuff...PP The component: TMPL_VAR NAME="COMPONENT"P /BODY /HTML together.cgi: my $component = HTML::Template-new(filename = 'larger.tmpl'); $template-param(STAND_ALONE_MODE = 0); $template-param(NAME = 'Sam'); my $template = HTML::Template-new(filename = 'larger.tmpl'); $template-param(COMPONENT = $component_template-output()); print "Content-Type: text/html\n\n"; print $template-output; Now to support the whole "returning an error code" idea you'd need to wrap component.tmpl in a module that knows when to return an error. For something that approaches this level of complexity with HTML::Template, take a look at HTML::Pager. As you can see, HTML::Template doesn't send any output prematurely to the user - the enclosing CGI or module can do whatever it wants with the output before printing it. So, did I totally misunderstand what you're looking for, or have I answered your prayers? -sam
form data handling in Embperl
Embperl doc states: If you do not specify a default value for an input tag and a value for that input tag is available in %fdat, Embperl will automatically insert this value and send it to the browser. I find that this is not the case when the input tags are not inserted verbatim into the embperl file. Using the shortcuts in CGI to generate form fields for instance, and printing them to the OUT filehandle, as in print OUT $q-textfield('name') does not seem to restore the field values upon reentry of the page. The same problem appears when I use something like [+ $q-textfield('name') +] It looks as if this is not parsed by embperl the same way straight HTML is. Is this a limitation of embperl, or am I missing something ? I'm using apache 1.3.9, mod_perl 1.21, and embperl 1.2b11 -- Vegard Vesterheim : Phone: +47 73593002 Runit AS: Fax: +47 73591700 N-7034 Trondheim, NORWAY: Email: [EMAIL PROTECTED]
leaaving modperl list(s)
This list is beyond my level of just plain apache understanding. Unfortunately I lost the mail that said how to join/leave. Sorry to submit to the non-admin list, but I lost a disk and don't remember what it was. How do I leave the list? TIA /Avi
Re: Ye Ol' Template System Thread
On Mon, 15 Nov 1999, Joshua Chamas wrote: Sam Tregar wrote: The only question I'm really itching to answer is which template system is fastest? Maybe I should cook up a benchmark suite. I suppose the hardest part about that will be finding a set of templates/scripts that constitute roughly equal tasks. What do you all think? After all, what's a 4H without a bake-off? I would like to see some generic web app benchmarked across web app systems, but have not the energy to do it, as HelloWorld was more than enough to manage. Both Matt Gerald a few months back suggested they were going to put together a more realistic benchmark, but don't know where they are with it. I gave up. It became obvious to me it was frivolous. There are so many different factors to think about - one important one being that it's not the performance that matters, but the ease of use, stability, and familiarity that are more important. There are more important ways I can spend my time :) BTW: Does the source garden project need a mail message parser? I wrote one for O'Reilly's WebBoard NNTP server and they've said I can release it open source (it's pretty independant to the rest of the app). The difference between this one and alternatives is it's memory usage: Nil. (or basically Nil - it uses temp files for storage because MIME and UU attachments can really bloat ram based solutions). -- Matt/ Details: FastNet Software Ltd - XML, Perl, Databases. Tagline: High Performance Web Solutions Web Sites: http://come.to/fastnet http://sergeant.org Available for Consultancy, Contracts and Training.
Re: Apache::ASP and SSI
Stefan Reitshamer wrote: Hi, I'd like to do server-side includes in my Apache::ASP file. How do I write my httpd.conf? I tried Location /perl/ AddHandler server-parsed .asp AddHandler perl-script .asp PerlHandler Apache::ASP /Location You can see an online demo of Apache::ASP supporting full SSI via filtering with Apache::Filter at: http://www.nodeworks.com/asp/eg/ssi_filter.ssi Here's the config: # .ssi for full ssi support, with Apache::Filter Files ~ (\.ssi) SetHandler perl-script PerlHandler Apache::ASP Apache::SSI PerlSetVar Filter On /Files -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
Re: Ye Ol' Template System Thread
Leslie Mikesell wrote: What I'm looking for is a 'nestable' way of handling the logic flow and HTML construction that will allow a page to be used as a stand-alone item (perhaps displayed in a frameset) or included in another page, but when it is included I'd like to have the option of letting its execution return a status that the including page could see before it sends out any HTML. Apache::ASP scripts can be executed standalone or as sub scripts, with !--#include file=...-- syntax. Embperl can do the same with its Execute() routine. So, Apache::ASP nestable logic is like: % if($condition) { % !--#include file=yes.inc args='yes'-- % } else { % !--#include file=no.inc args='no'-- % } % In the case of Apache::ASP, you can bail out of a subscript at anytime with $Response-End(), which will halt script execution as a special form of a die. Apache::ASP furthermore buffers output by default, so you can kill the script at anytime with an error, and the user would not get half a script's output, just a server error 500. For more info check out: includes http://www.nodeworks.com/asp/ssi.html $Response-End() http://www.nodeworks.com/asp/objects.html BufferingOn confighttp://www.nodeworks.com/asp/config.html#BufferingOn -- Joshua _ Joshua Chamas Chamas Enterprises Inc. NodeWorks free web link monitoring Huntington Beach, CA USA http://www.nodeworks.com1-714-625-4051
RE: Embperl: returnvalue of sub (was: session handling...)
Hi, By the way, how to return value from a subroutine defined with [$sub$][$endsub$]. It seems returning nothing now. Yes, it returns always zero. It's already on the todo list to return a value. Until then you can modify the args of the subroutine [$sub foo$] $_[0] = 5 ; [$endsub$] [- foo ($a) ; -] foo returned [+ $a +] Gerald ---Gerald Richter ecos electronic communication services gmbhInternet - Infodatenbanken - Apache - Perl - mod_perl - EmbperlE-Mail: [EMAIL PROTECTED] Tel: +49-6133/925151WWW: http://www.ecos.de Fax: +49-6133/925152---
Seg fault on fork w/ PerlModule
I have compiled the following: Apache 1.3.9 mod_perl 1.21 (PERL_AUTHEN PERL_LOG PERL_STACKED_HANDLERS) on: Ultra 10 Solaris 7 with: gcc 2.95.2 19991024 perl 5.005_03 When starting an httpd process with a 'PerlModule' defined in the conf file, the process will seg fault when it attempts to fork: open("/opt/apache/logs/access_log", O_WRONLY|O_APPEND|O_CREAT, 0644) = 3 fcntl(3, F_DUPFD, 0x000F) = 16 close(3)= 0 chdir("/") = 0 fork() = 16024 Incurred fault #6, FLTBOUNDS %pc = 0xD002 siginfo: SIGSEGV SEGV_MAPERR addr=0xD002 Received signal #11, SIGSEGV [default] siginfo: SIGSEGV SEGV_MAPERR addr=0xD002 *** process killed *** However, comment out the 'PerlModule' statement, and the process forks fine and exits: open("/opt/apache/logs/access_log", O_WRONLY|O_APPEND|O_CREAT, 0644) = 3 fcntl(3, F_DUPFD, 0x000F) = 16 close(3)= 0 chdir("/") = 0 fork() = 16030 llseek(0, 0, SEEK_CUR) = 101628 _exit(0) I didn't see anything about this on the maillist... get anyone give me an idea of where I should at least start to track down this problem? Thanks, - Tony