Re: Registry and mod_include - multiple invocations of a script in an SSI-parsed file
Hi Brett, My guess is that you run into a problem of the CGI module not resetting itself between executions of your code. As a test you could try entering the line. CGI::initialize_globals(); explicitly in your script before calling param(). 2012-01-02 22:41, Brett Lee wrote: Hello, First, thank you very much for your time consideration of this problem, Have been trying to resolve an issue without success. The issue I'm seeing is that calling the same script several times within a SSI-parsed file causes each invocation of the script to produce the same result even though different results should be seen. To clarify, please find inlined below an example SSI-parsed file and script: !-- file test.shtml -- html head/head body !--#include virtual=/cgi-bin/test.cgi?count=5-- !--#include virtual=/cgi-bin/test.cgi?count=10-- !--#include virtual=/cgi-bin/test.cgi?count=30-- /body html #!/usr/bin/perl -w # test.cgi use strict; use CGI qw(-compile :all); my $count = param('count'); my $a = 0; print header; while ( $a $count) { print ++$a; } When run from the default /var/www/cgi-bin/ directory, execution works as expected; results are 1..5, 1..10 and 1..30. However, when the executable is run from the ModPerl Registry directory below, each invocation counts only to 5. Directory /var/www/registry SetHandler perl-script PerlResponseHandler ModPerl::Registry # PerlOptions +ParseHeaders (prevented 2+ invocations) Options +ExecCGI /Directory Sure seems like something is caching part or all of the command/param. Hoping to find out what. Once again, thanks for your time consideration. Note: previously posted at: http://www.perlmonks.org/?node_id=945804 Best regards, - - Brett Lee Encrypt your data with PDS - http://crypto.brettlee.com/ -- Mårten Svantesson Senior Developer Travelocity Nordic +46 (0)8 505 787 23
Re: Registry and mod_include - multiple invocations of a script in an SSI-parsed file
On 11 Jan 2012, at 15:29, Mårten Svantesson wrote: Hi Brett, My guess is that you run into a problem of the CGI module not resetting itself between executions of your code. As a test you could try entering the line. CGI::initialize_globals(); explicitly in your script before calling param(). Ooooh. I have a situation where in a perfectly ordinary Apache::Registry script, sometimes Template::Toolkit doesn't add the auto-headers and footers to the pages. I wonder if abw doing something jiggy that might be upsetting the globals. /me tries... Wow. That did the trick! Mårten, if we ever meet, I owe you lots of Aquavit or equivalent.
Re: Registry and mod_include - multiple invocations of a script in an SSI-parsed file
Thanks for the reply Mårten, Sorry, should have posted that I found the (same) answer a few days back. http://www.perlmonks.org/?node_id=946773 Didn't hear a peep from the list after a couple attempts, so abandoned the query. Best regards, - - Brett Lee Encrypt your data with PDS - http://crypto.brettlee.com/ From: Mårten Svantesson marten.svantes...@travelocitynordic.com To: modperl@perl.apache.org Sent: Wednesday, January 11, 2012 3:29 PM Subject: Re: Registry and mod_include - multiple invocations of a script in an SSI-parsed file Hi Brett, My guess is that you run into a problem of the CGI module not resetting itself between executions of your code. As a test you could try entering the line. CGI::initialize_globals(); explicitly in your script before calling param(). 2012-01-02 22:41, Brett Lee wrote: Hello, First, thank you very much for your time consideration of this problem, Have been trying to resolve an issue without success. The issue I'm seeing is that calling the same script several times within a SSI-parsed file causes each invocation of the script to produce the same result even though different results should be seen. To clarify, please find inlined below an example SSI-parsed file and script: !-- file test.shtml -- html head/head body !--#include virtual=/cgi-bin/test.cgi?count=5-- !--#include virtual=/cgi-bin/test.cgi?count=10-- !--#include virtual=/cgi-bin/test.cgi?count=30-- /body html #!/usr/bin/perl -w # test.cgi use strict; use CGI qw(-compile :all); my $count = param('count'); my $a = 0; print header; while ( $a $count) { print ++$a; } When run from the default /var/www/cgi-bin/ directory, execution works as expected; results are 1..5, 1..10 and 1..30. However, when the executable is run from the ModPerl Registry directory below, each invocation counts only to 5. Directory /var/www/registry SetHandler perl-script PerlResponseHandler ModPerl::Registry # PerlOptions +ParseHeaders (prevented 2+ invocations) Options +ExecCGI /Directory Sure seems like something is caching part or all of the command/param. Hoping to find out what. Once again, thanks for your time consideration. Note: previously posted at: http://www.perlmonks.org/?node_id=945804 Best regards, - - Brett Lee Encrypt your data with PDS - http://crypto.brettlee.com/ -- Mårten Svantesson Senior Developer Travelocity Nordic +46 (0)8 505 787 23
Re: Registry and mod_include - multiple invocations of a script in an SSI-parsed file
Hello, Thought to reboot this query from a couple days ago in hopes of gaining some insight into a solution. Have added configuration information: Linux - CentOS mod_perl-2.0.4-6.el5 httpd-2.2.3-45.el5.centos perl-5.8.8-32.el5_5.2 /usr/lib/perl5/5.8.8/CGI.pm shows version 3.15 Many thanks! Best regards, - - Brett Lee Encrypt your data with PDS - http://crypto.brettlee.com/ From: Brett Lee brett...@yahoo.com To: modperl@perl.apache.org modperl@perl.apache.org Sent: Monday, January 2, 2012 2:41 PM Subject: Registry and mod_include - multiple invocations of a script in an SSI-parsed file Hello, First, thank you very much for your time consideration of this problem, Have been trying to resolve an issue without success. The issue I'm seeing is that calling the same script several times within a SSI-parsed file causes each invocation of the script to produce the same result even though different results should be seen. To clarify, please find inlined below an example SSI-parsed file and script: !-- file test.shtml -- html head/head body !--#include virtual=/cgi-bin/test.cgi?count=5-- !--#include virtual=/cgi-bin/test.cgi?count=10-- !--#include virtual=/cgi-bin/test.cgi?count=30-- /body html #!/usr/bin/perl -w # test.cgi use strict; use CGI qw(-compile :all); my $count = param('count'); my $a = 0; print header; while ( $a $count) { print ++$a; } When run from the default /var/www/cgi-bin/ directory, execution works as expected; results are 1..5, 1..10 and 1..30. However, when the executable is run from the ModPerl Registry directory below, each invocation counts only to 5. Directory /var/www/registry SetHandler perl-script PerlResponseHandler ModPerl::Registry # PerlOptions +ParseHeaders (prevented 2+ invocations) Options +ExecCGI /Directory Sure seems like something is caching part or all of the command/param. Hoping to find out what. Once again, thanks for your time consideration. Note: previously posted at: http://www.perlmonks.org/?node_id=945804 Best regards, - - Brett Lee Encrypt your data with PDS - http://crypto.brettlee.com/