html-template-users Mailing List for HTML::Template (Page 21)
Brought to you by:
samtregar
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(42) |
Jul
(80) |
Aug
(77) |
Sep
(97) |
Oct
(65) |
Nov
(80) |
Dec
(39) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(63) |
Feb
(47) |
Mar
(45) |
Apr
(63) |
May
(67) |
Jun
(51) |
Jul
(78) |
Aug
(37) |
Sep
(45) |
Oct
(59) |
Nov
(50) |
Dec
(70) |
2004 |
Jan
(23) |
Feb
(90) |
Mar
(37) |
Apr
(53) |
May
(111) |
Jun
(71) |
Jul
(35) |
Aug
(58) |
Sep
(35) |
Oct
(35) |
Nov
(35) |
Dec
(20) |
2005 |
Jan
(51) |
Feb
(19) |
Mar
(20) |
Apr
(8) |
May
(26) |
Jun
(14) |
Jul
(49) |
Aug
(24) |
Sep
(20) |
Oct
(49) |
Nov
(17) |
Dec
(53) |
2006 |
Jan
(12) |
Feb
(26) |
Mar
(45) |
Apr
(19) |
May
(19) |
Jun
(13) |
Jul
(11) |
Aug
(9) |
Sep
(10) |
Oct
(16) |
Nov
(17) |
Dec
(13) |
2007 |
Jan
(9) |
Feb
(12) |
Mar
(28) |
Apr
(33) |
May
(12) |
Jun
(12) |
Jul
(19) |
Aug
(4) |
Sep
(4) |
Oct
(5) |
Nov
(5) |
Dec
(13) |
2008 |
Jan
(6) |
Feb
(7) |
Mar
(14) |
Apr
(16) |
May
(3) |
Jun
(1) |
Jul
(12) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(9) |
2009 |
Jan
(9) |
Feb
|
Mar
(10) |
Apr
(1) |
May
|
Jun
(6) |
Jul
(5) |
Aug
(3) |
Sep
(7) |
Oct
(1) |
Nov
(15) |
Dec
(1) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
(9) |
May
|
Jun
|
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
(3) |
Mar
|
Apr
(28) |
May
|
Jun
|
Jul
(3) |
Aug
(4) |
Sep
(3) |
Oct
|
Nov
(8) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2016 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Matthew B. <dr...@ma...> - 2006-03-08 04:19:17
|
ok so I used telnet to grab a few instances of our CGI using HTML::Template and the caching is still present. drmac-mac:~ drmac$ telnet www.ourdomain.com 80 Trying 170.86.88.385... Connected to www.ourdomain.com. Escape character is '^]'. GET /pages/sctest/roomlogin_new.cgi?companyID=2 <snip> <p>Welcome to the <strong>omNovia</strong> Conference Center </snip> drmac-mac:~ drmac$ telnet www.ourdomain.com 80 Trying 170.86.88.385... Connected to www.ourdomain.com. Escape character is '^]'. GET /pages/sctest/roomlogin_new.cgi?companyID=1 <snip> <p>Welcome to the <strong>Traders International</strong> Conference Center </snip> drmac-mac:~ drmac$ telnet www.ourdomain.com 80 Trying 170.86.88.385... Connected to www.ourdomain.com. Escape character is '^]'. GET /pages/sctest/roomlogin_new.cgi?companyID=45 <snip> <p>Welcome to the <strong>omNovia</strong> Conference Center </snip> Any ideas? I should mention that roomlogin_new.cgi does use strict while our old CGI does not. And the old CGI doesn't have this problem even though both run under the same mod-perl enabled dir. Thanks, Matthew |
From: Matthew B. <dr...@ma...> - 2006-03-07 17:28:48
|
I jumped the gun on this one. I have two versions of our CGI. They are exactly the same except version 2 uses HTML::Template. Version 1 doesn't experience this cache problem. Version 2 does. This is why I believe HTMLTemp is causing this in conjunction with mod_perl. I'm going to try a telnet test and see what results come. -Matthew > Hmm. I am using strict, but I do have many "globals". Here are the > first few lines of our program: > > #!/usr/bin/perl > > use strict; > use warnings; > > use lib '/path/to/something/'; > use tools qw($dbh $webpage_obj &displayError $template &messageDie); > > $template = new HTML::Template(filename => > '/home/omnovia/public_html/pages/sctest/templates/background.tpl', > path => > '/home/omnovia/public_html/pages/sctest/templates/', > cache => 1, > debug => 1, > stack_debug => 1, > cache_debug => 1, > die_on_bad_params => 0); > > tools::DBConnect(); > > my ($companyID, $firstName, $lastName, $companyUsername); > <several more lines of my's before getting into functions> > > As I'm sure you have all learned by now, I'm not a perl programmer.. > > Thanks, > -Matthew |
From: Paulsen, B. <BPa...@le...> - 2006-03-07 15:29:14
|
If you can put something together easily and test it out, I would suggest the function that you are describing. If you are using the CGI package, you should be able to simply pass around the CGI object. Brian=20 -----Original Message----- =46rom: htm...@li... [mailto:htm...@li...] On Behalf Of Matthew Boehm Sent: Tuesday, March 07, 2006 10:22 AM To: htm...@li... Subject: Re: [htmltmpl] mod_perl usage Hmm. I am using strict, but I do have many "globals". Here are the =66irst few lines of our program: #!/usr/bin/perl use strict; use warnings; use lib '/path/to/something/'; use tools qw($dbh $webpage_obj &displayError $template &messageDie); $template =3D new HTML::Template(filename =3D> '/home/omnovia/public_html/pages/sctest/templates/background.tpl', path =3D> '/home/omnovia/public_html/pages/sctest/templates/', cache =3D> 1, debug =3D> 1, stack_debug =3D> 1, cache_debug =3D> 1, die_on_bad_params =3D> 0); tools::DBConnect(); my ($companyID, $firstName, $lastName, $companyUsername); <several more lines of my's before getting into functions> Interestingly enough, companyID (the main var) is listed in the first my block. So that's global scope and would not be cleared=3F Beginning to make sense now. $companyID is used in just about every =66unction, which is why it was made global. Should I instead write a =66unction that gets all the vars from the web call and just pass them in between function calls=3F As I'm sure you have all learned by now, I'm not a perl programmer.. Thanks, -Matthew ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel=3Fcmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 _______________________________________________ Html-template-users mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/html-template-users ---------------------------------------------------------------------------= --- This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended recipient= = of this message you are hereby notified that any review, dissemination, = distribution or copying of this message is strictly prohibited. This = communication is for information purposes only and should not be regarded a= s= an offer to sell or as a solicitation of an offer to buy any financial = product, an official confirmation of any transaction, or as an official = statement of Lehman Brothers. Email transmission cannot be guaranteed to b= e= secure or error-free. Therefore, we do not represent that this informatio= n= is complete or accurate and it should not be relied upon as such. All = information is subject to change without notice. |
From: Matthew B. <dr...@ma...> - 2006-03-07 15:22:13
|
Hmm. I am using strict, but I do have many "globals". Here are the first few lines of our program: #!/usr/bin/perl use strict; use warnings; use lib '/path/to/something/'; use tools qw($dbh $webpage_obj &displayError $template &messageDie); $template = new HTML::Template(filename => '/home/omnovia/public_html/pages/sctest/templates/background.tpl', path => '/home/omnovia/public_html/pages/sctest/templates/', cache => 1, debug => 1, stack_debug => 1, cache_debug => 1, die_on_bad_params => 0); tools::DBConnect(); my ($companyID, $firstName, $lastName, $companyUsername); <several more lines of my's before getting into functions> Interestingly enough, companyID (the main var) is listed in the first my block. So that's global scope and would not be cleared? Beginning to make sense now. $companyID is used in just about every function, which is why it was made global. Should I instead write a function that gets all the vars from the web call and just pass them in between function calls? As I'm sure you have all learned by now, I'm not a perl programmer.. Thanks, -Matthew |
From: Paulsen, B. <BPa...@le...> - 2006-03-07 15:12:10
|
Ok... I see that in most of my code, I'm calling HTML::Template with the =66ollowing parameters: cache =3D> 1, double_file_cache =3D> 1 When using HTML::Template::Expr, I do NOT set double_file_cache to 1 (I think because I had caching issues like you are describing)=20 -----Original Message----- =46rom: htm...@li... [mailto:htm...@li...] On Behalf Of Matthew Boehm Sent: Tuesday, March 07, 2006 9:59 AM To: htm...@li... Subject: Re: [htmltmpl] mod_perl usage Already using use strict, and using use warnings. And yes, the script works fine. -Matthew Paulsen, Brian wrote: > I have an idea of where the caching is happening... >=20 > Put this at the top of your script : > use strict; >=20 > Does your script still work=3F >=20 > -----Original Message----- > From: htm...@li... > [mailto:htm...@li...] On Behalf Of=20 > Matthew Boehm > Sent: Tuesday, March 07, 2006 9:44 AM > To: htm...@li... > Subject: Re: [htmltmpl] mod_perl usage >=20 > Here is some debug information. What follows is 3 attempts at my CGI.=20 > First was with the companyID of 1 (Traders International) 2nd was ID=20 > 26 (Trading Zoo) and 3rd was ID 2 (omNovia). Notice that the #3=20 > attempt shows the same values from attempt #1 and that #3's debug=20 > output is MUCH less than the other 2. >=20 > So who is caching this=3F Sounds like mod_perl is. This is bad. >=20 > apologies for line wrapping.. >=20 > Thanks, > Matthew >=20 > **** attempt #1 **** >=20 > ### HTML::Template Debug ### In _parse: > ### HTML::Template Debug ### /templates/background.tpl : line 1 :=20 > TMPL_IF login_menu start > ### HTML::Template Debug ### /templates/background.tpl : line 2 :=20 > INCLUDE login_menu.tpl > ### HTML::Template Debug ### /templates/login_menu.tpl : line 1 :=20 > parsed VAR header ### HTML::Template Debug ###=20 > /templates/login_menu.tpl : line > 13 :=20 > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 17 :=20 > parsed VAR companyname > ### HTML::Template Debug ### /templates/login_menu.tpl : line 22 :=20 > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 23 :=20 > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 31 :=20 > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 32 :=20 > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 35 :=20 > parsed VAR footer > ### HTML::Template Debug ### /templates/background.tpl : line 2 :=20 > /TMPL_IF end > ### HTML::Template Debug ### /templates/background.tpl : line 4 :=20 > TMPL_IF login_page start > ### HTML::Template Debug ### /templates/background.tpl : line 5 :=20 > INCLUDE login_page.tpl > ### HTML::Template Debug ### /templates/background.tpl : line 5 :=20 > /TMPL_IF end > ### HTML::Template _param Stack Dump ### > bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' > ), > ], 'HTML::Template::COND' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::NOOP' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' > ), > ], 'HTML::Template::COND' ), > msg.innerHTML =3D "Your subscription expires in " +=20 > daysTillExpired + " days. " + > document.getElementById(\'popupinfo\').innerHTML +=3D=20 > " <span style=3D\\"font-weight: bold; color: #FF0000;\\">Dual=20 > Windows disabled due to popup blocker.</span>"; > _javarow.innerHTML =3D _html; > r.innerHTML =3D "<font color=3Dred " + fSize + "><b>" + t +=20 > "</b></font>" + addedTxt; > c.innerHTML =3D "<b>Event Name:</b>" + sText; > c.innerHTML=3D""; ### HTML::Template Cache=20 > Debug ### CACHE LOAD : > /templates/background.tpl =3D> a3b4215ada4a08b236710034cb1dd9c3 ###=20 > HTML::Template Debug ### In output ### HTML::Template output Stack=20 > Dump ### > bless( do{\(my $o =3D 1)}, 'HTML::Template::VAR' ), > ], 'HTML::Template::COND' ), > bless( do{\(my $o =3D '<!DOCTYPE HTML PUBLIC \'-//W3C//DTD=20 > HTML > 4.01 Transitional//EN\' \'http://www.w3.org/TR/html4/loose.dtd\'> > <td>')}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D '1')}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D 'Traders International')},=20 > 'HTML::Template::VAR' ), </html>')}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::NOOP' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' > ), > ], 'HTML::Template::COND' ), > msg.innerHTML =3D "Your subscription expires in " +=20 > daysTillExpired + " days. " + > document.getElementById(\'popupinfo\').innerHTML +=3D=20 > " <span style=3D\\"font-weight: bold; color: #FF0000;\\">Dual=20 > Windows disabled due to popup blocker.</span>"; > _javarow.innerHTML =3D _html; > r.innerHTML =3D "<font color=3Dred " + fSize + "><b>" + t +=20 > "</b></font>" + addedTxt; > c.innerHTML =3D "<b>Event Name:</b>" + sText; > c.innerHTML=3D""; >=20 >=20 > **** attempt #2 ****** >=20 >=20 > ### HTML::Template Debug ### In _parse: > ### HTML::Template Debug ### /templates/background.tpl : line 1 :=20 > TMPL_IF login_menu start > ### HTML::Template Debug ### /templates/background.tpl : line 2 :=20 > INCLUDE login_menu.tpl > ### HTML::Template Debug ### /templates/login_menu.tpl : line 1 :=20 > parsed VAR header ### HTML::Template Debug ###=20 > /templates/login_menu.tpl : line > 13 :=20 > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 17 :=20 > parsed VAR companyname > ### HTML::Template Debug ### /templates/login_menu.tpl : line 22 :=20 > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 23 :=20 > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 31 :=20 > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 32 :=20 > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 35 :=20 > parsed VAR footer > ### HTML::Template Debug ### /templates/background.tpl : line 2 :=20 > /TMPL_IF end > ### HTML::Template Debug ### /templates/background.tpl : line 4 :=20 > TMPL_IF login_page start > ### HTML::Template Debug ### /templates/background.tpl : line 5 :=20 > INCLUDE login_page.tpl > ### HTML::Template Debug ### /templates/background.tpl : line 5 :=20 > /TMPL_IF end > ### HTML::Template _param Stack Dump ### > bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' > ), > ], 'HTML::Template::COND' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::NOOP' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' > ), > ], 'HTML::Template::COND' ), > msg.innerHTML =3D "Your subscription expires in " +=20 > daysTillExpired + " days. " + > document.getElementById(\'popupinfo\').innerHTML +=3D=20 > " <span style=3D\\"font-weight: bold; color: #FF0000;\\">Dual=20 > Windows disabled due to popup blocker.</span>"; > _javarow.innerHTML =3D _html; > r.innerHTML =3D "<font color=3Dred " + fSize + "><b>" + t +=20 > "</b></font>" + addedTxt; > c.innerHTML =3D "<b>Event Name:</b>" + sText; > c.innerHTML=3D""; ### HTML::Template Cache=20 > Debug ### CACHE LOAD : > /templates/background.tpl =3D> a3b4215ada4a08b236710034cb1dd9c3 ###=20 > HTML::Template Debug ### In output ### HTML::Template output Stack=20 > Dump ### > bless( do{\(my $o =3D 1)}, 'HTML::Template::VAR' ), > ], 'HTML::Template::COND' ), > bless( do{\(my $o =3D '<!DOCTYPE HTML PUBLIC \'-//W3C//DTD=20 > HTML > 4.01 Transitional//EN\' \'http://www.w3.org/TR/html4/loose.dtd\'> > <td>')}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D '26')}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D 'TradingZoo')}, 'HTML::Template::VAR'=20 > ), </html>')}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::NOOP' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' > ), > ], 'HTML::Template::COND' ), > msg.innerHTML =3D "Your subscription expires in " +=20 > daysTillExpired + " days. " + > document.getElementById(\'popupinfo\').innerHTML +=3D=20 > " <span style=3D\\"font-weight: bold; color: #FF0000;\\">Dual=20 > Windows disabled due to popup blocker.</span>"; > _javarow.innerHTML =3D _html; > r.innerHTML =3D "<font color=3Dred " + fSize + "><b>" + t +=20 > "</b></font>" + addedTxt; > c.innerHTML =3D "<b>Event Name:</b>" + sText; > c.innerHTML=3D""; >=20 >=20 > ******* attempt #3 ****** >=20 >=20 > ### HTML::Template Cache Debug ### CACHE HIT :=20 > /some/path//pages/sctest/templates/background.tpl =3D> > a3b4215ada4a08b236710034cb1dd9c3 > ### HTML::Template Debug ### In output ### HTML::Template output Stack > Dump ### > bless( do{\(my $o =3D 1)}, 'HTML::Template::VAR' ), > ], 'HTML::Template::COND' ), > bless( do{\(my $o =3D '<!DOCTYPE HTML PUBLIC \'-//W3C//DTD=20 > HTML > 4.01 Transitional//EN\' \'http://www.w3.org/TR/html4/loose.dtd\'> > <td>')}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D '1')}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D 'Traders International')},=20 > 'HTML::Template::VAR' ), </html>')}, 'HTML::Template::VAR' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::NOOP' ), > bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' > ), > ], 'HTML::Template::COND' ), > msg.innerHTML =3D "Your subscription expires in " +=20 > daysTillExpired + " days. " + > document.getElementById(\'popupinfo\').innerHTML +=3D=20 > " <span style=3D\\"font-weight: bold; color: #FF0000;\\">Dual=20 > Windows disabled due to popup blocker.</span>"; > _javarow.innerHTML =3D _html; > r.innerHTML =3D "<font color=3Dred " + fSize + "><b>" + t +=20 > "</b></font>" + addedTxt; > c.innerHTML =3D "<b>Event Name:</b>" + sText; > c.innerHTML=3D""; >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting=20 > language that extends applications into web and mobile media. Attend=20 > the live webcast and join the prime developer group breaking into this > new coding territory! > = http://sel.as-us.falkag.net/sel=3Fcmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D1216 > 42 _______________________________________________ > Html-template-users mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users >=20 >=20 >=20 > ---------------------------------------------------------------------- > -------- This message is intended only for the personal and=20 > confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting=20 > language that extends applications into web and mobile media. Attend=20 > the live webcast and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel=3Fcmd=3Dk&kid=110944&bid$1720&dat=121642 > _______________________________________________ > Html-template-users mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel=3Fcmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 _______________________________________________ Html-template-users mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/html-template-users ---------------------------------------------------------------------------= --- This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended recipient= = of this message you are hereby notified that any review, dissemination, = distribution or copying of this message is strictly prohibited. This = communication is for information purposes only and should not be regarded a= s= an offer to sell or as a solicitation of an offer to buy any financial = product, an official confirmation of any transaction, or as an official = statement of Lehman Brothers. Email transmission cannot be guaranteed to b= e= secure or error-free. Therefore, we do not represent that this informatio= n= is complete or accurate and it should not be relied upon as such. All = information is subject to change without notice. |
From: Paulsen, B. <BPa...@le...> - 2006-03-07 14:59:40
|
To expound a bit more on the "use strict;" line... The big difference between mod_perl and normal CGI execution is that in mod_perl, the forked child Apache process is used to serve up content. In normal CGI execution, a separate process is forked off and that is used. If you have global variables in your script, it doesn't matter in normal CGI execution because those are cleaned up when the forked process exits. In mod_perl, since there is no forked subprocess, global variables never get cleaned up. Instead, they are reused the next time that the script is executed. So, if you have something where your variables are undeclared and uninitialized, it will appear that mod_perl is caching old values for you. Having the "use strict;" line forces you to declare your variables, which usually puts them in a local scope. =46WIW, all of my CGI scripts look like this... use strict; sub printPage { ... Do all my processing here... } printPage; -----Original Message----- =46rom: htm...@li... [mailto:htm...@li...] On Behalf Of Matthew Boehm Sent: Tuesday, March 07, 2006 9:44 AM To: htm...@li... Subject: Re: [htmltmpl] mod_perl usage Here is some debug information. What follows is 3 attempts at my CGI.=20 =46irst was with the companyID of 1 (Traders International) 2nd was ID 26 (Trading Zoo) and 3rd was ID 2 (omNovia). Notice that the #3 attempt shows the same values from attempt #1 and that #3's debug output is MUCH less than the other 2. So who is caching this=3F Sounds like mod_perl is. This is bad. apologies for line wrapping.. Thanks, Matthew **** attempt #1 **** ### HTML::Template Debug ### In _parse: ### HTML::Template Debug ### /templates/background.tpl : line 1 :=20 TMPL_IF login_menu start ### HTML::Template Debug ### /templates/background.tpl : line 2 :=20 INCLUDE login_menu.tpl ### HTML::Template Debug ### /templates/login_menu.tpl : line 1 : parsed VAR header ### HTML::Template Debug ### /templates/login_menu.tpl : line 13 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 17 :=20 parsed VAR companyname ### HTML::Template Debug ### /templates/login_menu.tpl : line 22 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 23 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 31 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 32 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 35 :=20 parsed VAR footer ### HTML::Template Debug ### /templates/background.tpl : line 2 :=20 /TMPL_IF end ### HTML::Template Debug ### /templates/background.tpl : line 4 :=20 TMPL_IF login_page start ### HTML::Template Debug ### /templates/background.tpl : line 5 :=20 INCLUDE login_page.tpl ### HTML::Template Debug ### /templates/background.tpl : line 5 :=20 /TMPL_IF end ### HTML::Template _param Stack Dump ### bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::NOOP' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), msg.innerHTML =3D "Your subscription expires in " + daysTillExpired + " days. " + document.getElementById(\'popupinfo\').innerHTML +=3D " <span style=3D\\"font-weight: bold; color: #FF0000;\\">Dual Windows disabled due to popup blocker.</span>"; _javarow.innerHTML =3D _html; r.innerHTML =3D "<font color=3Dred " + fSize + "><b>" + t + "</b></font>" + addedTxt; c.innerHTML =3D "<b>Event Name:</b>" + sText; c.innerHTML=3D""; ### HTML::Template Cache Debug ### CACHE LOAD :=20 /templates/background.tpl =3D> a3b4215ada4a08b236710034cb1dd9c3 ### HTML::Template Debug ### In output ### HTML::Template output Stack Dump ### bless( do{\(my $o =3D 1)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), bless( do{\(my $o =3D '<!DOCTYPE HTML PUBLIC \'-//W3C//DTD HTML 4.01 Transitional//EN\' \'http://www.w3.org/TR/html4/loose.dtd\'> <td>')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D '1')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D 'Traders International')}, 'HTML::Template::VAR' ), </html>')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::NOOP' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), msg.innerHTML =3D "Your subscription expires in " + daysTillExpired + " days. " + document.getElementById(\'popupinfo\').innerHTML +=3D " <span style=3D\\"font-weight: bold; color: #FF0000;\\">Dual Windows disabled due to popup blocker.</span>"; _javarow.innerHTML =3D _html; r.innerHTML =3D "<font color=3Dred " + fSize + "><b>" + t + "</b></font>" + addedTxt; c.innerHTML =3D "<b>Event Name:</b>" + sText; c.innerHTML=3D""; **** attempt #2 ****** ### HTML::Template Debug ### In _parse: ### HTML::Template Debug ### /templates/background.tpl : line 1 :=20 TMPL_IF login_menu start ### HTML::Template Debug ### /templates/background.tpl : line 2 :=20 INCLUDE login_menu.tpl ### HTML::Template Debug ### /templates/login_menu.tpl : line 1 : parsed VAR header ### HTML::Template Debug ### /templates/login_menu.tpl : line 13 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 17 :=20 parsed VAR companyname ### HTML::Template Debug ### /templates/login_menu.tpl : line 22 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 23 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 31 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 32 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 35 :=20 parsed VAR footer ### HTML::Template Debug ### /templates/background.tpl : line 2 :=20 /TMPL_IF end ### HTML::Template Debug ### /templates/background.tpl : line 4 :=20 TMPL_IF login_page start ### HTML::Template Debug ### /templates/background.tpl : line 5 :=20 INCLUDE login_page.tpl ### HTML::Template Debug ### /templates/background.tpl : line 5 :=20 /TMPL_IF end ### HTML::Template _param Stack Dump ### bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::NOOP' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), msg.innerHTML =3D "Your subscription expires in " + daysTillExpired + " days. " + document.getElementById(\'popupinfo\').innerHTML +=3D " <span style=3D\\"font-weight: bold; color: #FF0000;\\">Dual Windows disabled due to popup blocker.</span>"; _javarow.innerHTML =3D _html; r.innerHTML =3D "<font color=3Dred " + fSize + "><b>" + t + "</b></font>" + addedTxt; c.innerHTML =3D "<b>Event Name:</b>" + sText; c.innerHTML=3D""; ### HTML::Template Cache Debug ### CACHE LOAD :=20 /templates/background.tpl =3D> a3b4215ada4a08b236710034cb1dd9c3 ### HTML::Template Debug ### In output ### HTML::Template output Stack Dump ### bless( do{\(my $o =3D 1)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), bless( do{\(my $o =3D '<!DOCTYPE HTML PUBLIC \'-//W3C//DTD HTML 4.01 Transitional//EN\' \'http://www.w3.org/TR/html4/loose.dtd\'> <td>')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D '26')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D 'TradingZoo')}, 'HTML::Template::VAR' ), </html>')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::NOOP' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), msg.innerHTML =3D "Your subscription expires in " + daysTillExpired + " days. " + document.getElementById(\'popupinfo\').innerHTML +=3D " <span style=3D\\"font-weight: bold; color: #FF0000;\\">Dual Windows disabled due to popup blocker.</span>"; _javarow.innerHTML =3D _html; r.innerHTML =3D "<font color=3Dred " + fSize + "><b>" + t + "</b></font>" + addedTxt; c.innerHTML =3D "<b>Event Name:</b>" + sText; c.innerHTML=3D""; ******* attempt #3 ****** ### HTML::Template Cache Debug ### CACHE HIT :=20 /some/path//pages/sctest/templates/background.tpl =3D> a3b4215ada4a08b236710034cb1dd9c3 ### HTML::Template Debug ### In output ### HTML::Template output Stack Dump ### bless( do{\(my $o =3D 1)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), bless( do{\(my $o =3D '<!DOCTYPE HTML PUBLIC \'-//W3C//DTD HTML 4.01 Transitional//EN\' \'http://www.w3.org/TR/html4/loose.dtd\'> <td>')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D '1')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D 'Traders International')}, 'HTML::Template::VAR' ), </html>')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::NOOP' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), msg.innerHTML =3D "Your subscription expires in " + daysTillExpired + " days. " + document.getElementById(\'popupinfo\').innerHTML +=3D " <span style=3D\\"font-weight: bold; color: #FF0000;\\">Dual Windows disabled due to popup blocker.</span>"; _javarow.innerHTML =3D _html; r.innerHTML =3D "<font color=3Dred " + fSize + "><b>" + t + "</b></font>" + addedTxt; c.innerHTML =3D "<b>Event Name:</b>" + sText; c.innerHTML=3D""; ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel=3Fcmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 _______________________________________________ Html-template-users mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/html-template-users ---------------------------------------------------------------------------= --- This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended recipient= = of this message you are hereby notified that any review, dissemination, = distribution or copying of this message is strictly prohibited. This = communication is for information purposes only and should not be regarded a= s= an offer to sell or as a solicitation of an offer to buy any financial = product, an official confirmation of any transaction, or as an official = statement of Lehman Brothers. Email transmission cannot be guaranteed to b= e= secure or error-free. Therefore, we do not represent that this informatio= n= is complete or accurate and it should not be relied upon as such. All = information is subject to change without notice. |
From: Matthew B. <dr...@ma...> - 2006-03-07 14:59:34
|
Already using use strict, and using use warnings. And yes, the script works fine. -Matthew Paulsen, Brian wrote: > I have an idea of where the caching is happening... > > Put this at the top of your script : > use strict; > > Does your script still work? > > -----Original Message----- > From: htm...@li... > [mailto:htm...@li...] On Behalf Of > Matthew Boehm > Sent: Tuesday, March 07, 2006 9:44 AM > To: htm...@li... > Subject: Re: [htmltmpl] mod_perl usage > > Here is some debug information. What follows is 3 attempts at my CGI. > First was with the companyID of 1 (Traders International) 2nd was ID 26 > (Trading Zoo) and 3rd was ID 2 (omNovia). Notice that the #3 attempt > shows the same values from attempt #1 and that #3's debug output is MUCH > less than the other 2. > > So who is caching this? Sounds like mod_perl is. This is bad. > > apologies for line wrapping.. > > Thanks, > Matthew > > **** attempt #1 **** > > ### HTML::Template Debug ### In _parse: > ### HTML::Template Debug ### /templates/background.tpl : line 1 : > TMPL_IF login_menu start > ### HTML::Template Debug ### /templates/background.tpl : line 2 : > INCLUDE login_menu.tpl > ### HTML::Template Debug ### /templates/login_menu.tpl : line 1 : parsed > VAR header ### HTML::Template Debug ### /templates/login_menu.tpl : line > 13 : > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 17 : > parsed VAR companyname > ### HTML::Template Debug ### /templates/login_menu.tpl : line 22 : > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 23 : > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 31 : > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 32 : > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 35 : > parsed VAR footer > ### HTML::Template Debug ### /templates/background.tpl : line 2 : > /TMPL_IF end > ### HTML::Template Debug ### /templates/background.tpl : line 4 : > TMPL_IF login_page start > ### HTML::Template Debug ### /templates/background.tpl : line 5 : > INCLUDE login_page.tpl > ### HTML::Template Debug ### /templates/background.tpl : line 5 : > /TMPL_IF end > ### HTML::Template _param Stack Dump ### > bless( do{\(my $o = undef)}, 'HTML::Template::VAR' > ), > ], 'HTML::Template::COND' ), > bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o = undef)}, 'HTML::Template::NOOP' ), > bless( do{\(my $o = undef)}, 'HTML::Template::VAR' > ), > ], 'HTML::Template::COND' ), > msg.innerHTML = "Your subscription expires in " + > daysTillExpired + " days. " + > document.getElementById(\'popupinfo\').innerHTML += > " <span style=\\"font-weight: bold; color: #FF0000;\\">Dual Windows > disabled due to popup blocker.</span>"; > _javarow.innerHTML = _html; > r.innerHTML = "<font color=red " + fSize + "><b>" + t + > "</b></font>" + addedTxt; > c.innerHTML = "<b>Event Name:</b>" + sText; > c.innerHTML=""; ### HTML::Template Cache Debug > ### CACHE LOAD : > /templates/background.tpl => a3b4215ada4a08b236710034cb1dd9c3 ### > HTML::Template Debug ### In output ### HTML::Template output Stack Dump > ### > bless( do{\(my $o = 1)}, 'HTML::Template::VAR' ), > ], 'HTML::Template::COND' ), > bless( do{\(my $o = '<!DOCTYPE HTML PUBLIC \'-//W3C//DTD HTML > 4.01 Transitional//EN\' \'http://www.w3.org/TR/html4/loose.dtd\'> > <td>')}, 'HTML::Template::VAR' ), > bless( do{\(my $o = '1')}, 'HTML::Template::VAR' ), > bless( do{\(my $o = 'Traders International')}, > 'HTML::Template::VAR' ), </html>')}, 'HTML::Template::VAR' ), > bless( do{\(my $o = undef)}, 'HTML::Template::NOOP' ), > bless( do{\(my $o = undef)}, 'HTML::Template::VAR' > ), > ], 'HTML::Template::COND' ), > msg.innerHTML = "Your subscription expires in " + > daysTillExpired + " days. " + > document.getElementById(\'popupinfo\').innerHTML += > " <span style=\\"font-weight: bold; color: #FF0000;\\">Dual Windows > disabled due to popup blocker.</span>"; > _javarow.innerHTML = _html; > r.innerHTML = "<font color=red " + fSize + "><b>" + t + > "</b></font>" + addedTxt; > c.innerHTML = "<b>Event Name:</b>" + sText; > c.innerHTML=""; > > > **** attempt #2 ****** > > > ### HTML::Template Debug ### In _parse: > ### HTML::Template Debug ### /templates/background.tpl : line 1 : > TMPL_IF login_menu start > ### HTML::Template Debug ### /templates/background.tpl : line 2 : > INCLUDE login_menu.tpl > ### HTML::Template Debug ### /templates/login_menu.tpl : line 1 : parsed > VAR header ### HTML::Template Debug ### /templates/login_menu.tpl : line > 13 : > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 17 : > parsed VAR companyname > ### HTML::Template Debug ### /templates/login_menu.tpl : line 22 : > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 23 : > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 31 : > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 32 : > parsed VAR companyid > ### HTML::Template Debug ### /templates/login_menu.tpl : line 35 : > parsed VAR footer > ### HTML::Template Debug ### /templates/background.tpl : line 2 : > /TMPL_IF end > ### HTML::Template Debug ### /templates/background.tpl : line 4 : > TMPL_IF login_page start > ### HTML::Template Debug ### /templates/background.tpl : line 5 : > INCLUDE login_page.tpl > ### HTML::Template Debug ### /templates/background.tpl : line 5 : > /TMPL_IF end > ### HTML::Template _param Stack Dump ### > bless( do{\(my $o = undef)}, 'HTML::Template::VAR' > ), > ], 'HTML::Template::COND' ), > bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), > bless( do{\(my $o = undef)}, 'HTML::Template::NOOP' ), > bless( do{\(my $o = undef)}, 'HTML::Template::VAR' > ), > ], 'HTML::Template::COND' ), > msg.innerHTML = "Your subscription expires in " + > daysTillExpired + " days. " + > document.getElementById(\'popupinfo\').innerHTML += > " <span style=\\"font-weight: bold; color: #FF0000;\\">Dual Windows > disabled due to popup blocker.</span>"; > _javarow.innerHTML = _html; > r.innerHTML = "<font color=red " + fSize + "><b>" + t + > "</b></font>" + addedTxt; > c.innerHTML = "<b>Event Name:</b>" + sText; > c.innerHTML=""; ### HTML::Template Cache Debug > ### CACHE LOAD : > /templates/background.tpl => a3b4215ada4a08b236710034cb1dd9c3 ### > HTML::Template Debug ### In output ### HTML::Template output Stack Dump > ### > bless( do{\(my $o = 1)}, 'HTML::Template::VAR' ), > ], 'HTML::Template::COND' ), > bless( do{\(my $o = '<!DOCTYPE HTML PUBLIC \'-//W3C//DTD HTML > 4.01 Transitional//EN\' \'http://www.w3.org/TR/html4/loose.dtd\'> > <td>')}, 'HTML::Template::VAR' ), > bless( do{\(my $o = '26')}, 'HTML::Template::VAR' ), > bless( do{\(my $o = 'TradingZoo')}, 'HTML::Template::VAR' ), > </html>')}, 'HTML::Template::VAR' ), > bless( do{\(my $o = undef)}, 'HTML::Template::NOOP' ), > bless( do{\(my $o = undef)}, 'HTML::Template::VAR' > ), > ], 'HTML::Template::COND' ), > msg.innerHTML = "Your subscription expires in " + > daysTillExpired + " days. " + > document.getElementById(\'popupinfo\').innerHTML += > " <span style=\\"font-weight: bold; color: #FF0000;\\">Dual Windows > disabled due to popup blocker.</span>"; > _javarow.innerHTML = _html; > r.innerHTML = "<font color=red " + fSize + "><b>" + t + > "</b></font>" + addedTxt; > c.innerHTML = "<b>Event Name:</b>" + sText; > c.innerHTML=""; > > > ******* attempt #3 ****** > > > ### HTML::Template Cache Debug ### CACHE HIT : > /some/path//pages/sctest/templates/background.tpl => > a3b4215ada4a08b236710034cb1dd9c3 > ### HTML::Template Debug ### In output > ### HTML::Template output Stack Dump ### > bless( do{\(my $o = 1)}, 'HTML::Template::VAR' ), > ], 'HTML::Template::COND' ), > bless( do{\(my $o = '<!DOCTYPE HTML PUBLIC \'-//W3C//DTD HTML > 4.01 Transitional//EN\' \'http://www.w3.org/TR/html4/loose.dtd\'> > <td>')}, 'HTML::Template::VAR' ), > bless( do{\(my $o = '1')}, 'HTML::Template::VAR' ), > bless( do{\(my $o = 'Traders International')}, > 'HTML::Template::VAR' ), </html>')}, 'HTML::Template::VAR' ), > bless( do{\(my $o = undef)}, 'HTML::Template::NOOP' ), > bless( do{\(my $o = undef)}, 'HTML::Template::VAR' > ), > ], 'HTML::Template::COND' ), > msg.innerHTML = "Your subscription expires in " + > daysTillExpired + " days. " + > document.getElementById(\'popupinfo\').innerHTML += > " <span style=\\"font-weight: bold; color: #FF0000;\\">Dual Windows > disabled due to popup blocker.</span>"; > _javarow.innerHTML = _html; > r.innerHTML = "<font color=red " + fSize + "><b>" + t + > "</b></font>" + addedTxt; > c.innerHTML = "<b>Event Name:</b>" + sText; > c.innerHTML=""; > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language that extends applications into web and mobile media. Attend the > live webcast and join the prime developer group breaking into this new > coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Html-template-users mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users > > > > ------------------------------------------------------------------------------ > This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice. > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642 > _______________________________________________ > Html-template-users mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users |
From: Matthew B. <dr...@ma...> - 2006-03-07 14:58:17
|
> I use Apache::Registry (this has likely been replaced by the > ModPerl::Registry that you mention) From what I just read, Apache::Registry is the mod_perl version 1 for Apache1 and ModPerl::registry is mod_perl 2 for Apache2 > The scripts do get compiled and stored in memory and it's exactly what > you want. So even if the code is compiled, it will still accept and process different input? Well, duh, that makes sense. > It sounds to me that you are writing the output to a file and > then redirecting to that file. This is my HTML::Template output line: print "Content-Type: text/html\n\n", $template->output(); > The best thing to do in this example is use a text client (such as Will try that. Anything I should be looking for specifically? > If you are not including those > modules in an apache startup script, you are not even saving that. Can you explain this more? My script "use"es several other perl modules. Should I be loading those via Apache? Thanks, Matthew |
From: Paulsen, B. <BPa...@le...> - 2006-03-07 14:53:40
|
I have an idea of where the caching is happening... Put this at the top of your script : use strict;=20 Does your script still work=3F -----Original Message----- =46rom: htm...@li... [mailto:htm...@li...] On Behalf Of Matthew Boehm Sent: Tuesday, March 07, 2006 9:44 AM To: htm...@li... Subject: Re: [htmltmpl] mod_perl usage Here is some debug information. What follows is 3 attempts at my CGI.=20 =46irst was with the companyID of 1 (Traders International) 2nd was ID 26 (Trading Zoo) and 3rd was ID 2 (omNovia). Notice that the #3 attempt shows the same values from attempt #1 and that #3's debug output is MUCH less than the other 2. So who is caching this=3F Sounds like mod_perl is. This is bad. apologies for line wrapping.. Thanks, Matthew **** attempt #1 **** ### HTML::Template Debug ### In _parse: ### HTML::Template Debug ### /templates/background.tpl : line 1 :=20 TMPL_IF login_menu start ### HTML::Template Debug ### /templates/background.tpl : line 2 :=20 INCLUDE login_menu.tpl ### HTML::Template Debug ### /templates/login_menu.tpl : line 1 : parsed VAR header ### HTML::Template Debug ### /templates/login_menu.tpl : line 13 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 17 :=20 parsed VAR companyname ### HTML::Template Debug ### /templates/login_menu.tpl : line 22 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 23 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 31 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 32 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 35 :=20 parsed VAR footer ### HTML::Template Debug ### /templates/background.tpl : line 2 :=20 /TMPL_IF end ### HTML::Template Debug ### /templates/background.tpl : line 4 :=20 TMPL_IF login_page start ### HTML::Template Debug ### /templates/background.tpl : line 5 :=20 INCLUDE login_page.tpl ### HTML::Template Debug ### /templates/background.tpl : line 5 :=20 /TMPL_IF end ### HTML::Template _param Stack Dump ### bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::NOOP' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), msg.innerHTML =3D "Your subscription expires in " + daysTillExpired + " days. " + document.getElementById(\'popupinfo\').innerHTML +=3D " <span style=3D\\"font-weight: bold; color: #FF0000;\\">Dual Windows disabled due to popup blocker.</span>"; _javarow.innerHTML =3D _html; r.innerHTML =3D "<font color=3Dred " + fSize + "><b>" + t + "</b></font>" + addedTxt; c.innerHTML =3D "<b>Event Name:</b>" + sText; c.innerHTML=3D""; ### HTML::Template Cache Debug ### CACHE LOAD :=20 /templates/background.tpl =3D> a3b4215ada4a08b236710034cb1dd9c3 ### HTML::Template Debug ### In output ### HTML::Template output Stack Dump ### bless( do{\(my $o =3D 1)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), bless( do{\(my $o =3D '<!DOCTYPE HTML PUBLIC \'-//W3C//DTD HTML 4.01 Transitional//EN\' \'http://www.w3.org/TR/html4/loose.dtd\'> <td>')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D '1')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D 'Traders International')}, 'HTML::Template::VAR' ), </html>')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::NOOP' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), msg.innerHTML =3D "Your subscription expires in " + daysTillExpired + " days. " + document.getElementById(\'popupinfo\').innerHTML +=3D " <span style=3D\\"font-weight: bold; color: #FF0000;\\">Dual Windows disabled due to popup blocker.</span>"; _javarow.innerHTML =3D _html; r.innerHTML =3D "<font color=3Dred " + fSize + "><b>" + t + "</b></font>" + addedTxt; c.innerHTML =3D "<b>Event Name:</b>" + sText; c.innerHTML=3D""; **** attempt #2 ****** ### HTML::Template Debug ### In _parse: ### HTML::Template Debug ### /templates/background.tpl : line 1 :=20 TMPL_IF login_menu start ### HTML::Template Debug ### /templates/background.tpl : line 2 :=20 INCLUDE login_menu.tpl ### HTML::Template Debug ### /templates/login_menu.tpl : line 1 : parsed VAR header ### HTML::Template Debug ### /templates/login_menu.tpl : line 13 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 17 :=20 parsed VAR companyname ### HTML::Template Debug ### /templates/login_menu.tpl : line 22 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 23 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 31 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 32 :=20 parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 35 :=20 parsed VAR footer ### HTML::Template Debug ### /templates/background.tpl : line 2 :=20 /TMPL_IF end ### HTML::Template Debug ### /templates/background.tpl : line 4 :=20 TMPL_IF login_page start ### HTML::Template Debug ### /templates/background.tpl : line 5 :=20 INCLUDE login_page.tpl ### HTML::Template Debug ### /templates/background.tpl : line 5 :=20 /TMPL_IF end ### HTML::Template _param Stack Dump ### bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::NOOP' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), msg.innerHTML =3D "Your subscription expires in " + daysTillExpired + " days. " + document.getElementById(\'popupinfo\').innerHTML +=3D " <span style=3D\\"font-weight: bold; color: #FF0000;\\">Dual Windows disabled due to popup blocker.</span>"; _javarow.innerHTML =3D _html; r.innerHTML =3D "<font color=3Dred " + fSize + "><b>" + t + "</b></font>" + addedTxt; c.innerHTML =3D "<b>Event Name:</b>" + sText; c.innerHTML=3D""; ### HTML::Template Cache Debug ### CACHE LOAD :=20 /templates/background.tpl =3D> a3b4215ada4a08b236710034cb1dd9c3 ### HTML::Template Debug ### In output ### HTML::Template output Stack Dump ### bless( do{\(my $o =3D 1)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), bless( do{\(my $o =3D '<!DOCTYPE HTML PUBLIC \'-//W3C//DTD HTML 4.01 Transitional//EN\' \'http://www.w3.org/TR/html4/loose.dtd\'> <td>')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D '26')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D 'TradingZoo')}, 'HTML::Template::VAR' ), </html>')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::NOOP' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), msg.innerHTML =3D "Your subscription expires in " + daysTillExpired + " days. " + document.getElementById(\'popupinfo\').innerHTML +=3D " <span style=3D\\"font-weight: bold; color: #FF0000;\\">Dual Windows disabled due to popup blocker.</span>"; _javarow.innerHTML =3D _html; r.innerHTML =3D "<font color=3Dred " + fSize + "><b>" + t + "</b></font>" + addedTxt; c.innerHTML =3D "<b>Event Name:</b>" + sText; c.innerHTML=3D""; ******* attempt #3 ****** ### HTML::Template Cache Debug ### CACHE HIT :=20 /some/path//pages/sctest/templates/background.tpl =3D> a3b4215ada4a08b236710034cb1dd9c3 ### HTML::Template Debug ### In output ### HTML::Template output Stack Dump ### bless( do{\(my $o =3D 1)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), bless( do{\(my $o =3D '<!DOCTYPE HTML PUBLIC \'-//W3C//DTD HTML 4.01 Transitional//EN\' \'http://www.w3.org/TR/html4/loose.dtd\'> <td>')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D '1')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D 'Traders International')}, 'HTML::Template::VAR' ), </html>')}, 'HTML::Template::VAR' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::NOOP' ), bless( do{\(my $o =3D undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), msg.innerHTML =3D "Your subscription expires in " + daysTillExpired + " days. " + document.getElementById(\'popupinfo\').innerHTML +=3D " <span style=3D\\"font-weight: bold; color: #FF0000;\\">Dual Windows disabled due to popup blocker.</span>"; _javarow.innerHTML =3D _html; r.innerHTML =3D "<font color=3Dred " + fSize + "><b>" + t + "</b></font>" + addedTxt; c.innerHTML =3D "<b>Event Name:</b>" + sText; c.innerHTML=3D""; ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel=3Fcmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 _______________________________________________ Html-template-users mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/html-template-users ---------------------------------------------------------------------------= --- This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended recipient= = of this message you are hereby notified that any review, dissemination, = distribution or copying of this message is strictly prohibited. This = communication is for information purposes only and should not be regarded a= s= an offer to sell or as a solicitation of an offer to buy any financial = product, an official confirmation of any transaction, or as an official = statement of Lehman Brothers. Email transmission cannot be guaranteed to b= e= secure or error-free. Therefore, we do not represent that this informatio= n= is complete or accurate and it should not be relied upon as such. All = information is subject to change without notice. |
From: Matthew B. <dr...@ma...> - 2006-03-07 14:43:54
|
Here is some debug information. What follows is 3 attempts at my CGI. First was with the companyID of 1 (Traders International) 2nd was ID 26 (Trading Zoo) and 3rd was ID 2 (omNovia). Notice that the #3 attempt shows the same values from attempt #1 and that #3's debug output is MUCH less than the other 2. So who is caching this? Sounds like mod_perl is. This is bad. apologies for line wrapping.. Thanks, Matthew **** attempt #1 **** ### HTML::Template Debug ### In _parse: ### HTML::Template Debug ### /templates/background.tpl : line 1 : TMPL_IF login_menu start ### HTML::Template Debug ### /templates/background.tpl : line 2 : INCLUDE login_menu.tpl ### HTML::Template Debug ### /templates/login_menu.tpl : line 1 : parsed VAR header ### HTML::Template Debug ### /templates/login_menu.tpl : line 13 : parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 17 : parsed VAR companyname ### HTML::Template Debug ### /templates/login_menu.tpl : line 22 : parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 23 : parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 31 : parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 32 : parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 35 : parsed VAR footer ### HTML::Template Debug ### /templates/background.tpl : line 2 : /TMPL_IF end ### HTML::Template Debug ### /templates/background.tpl : line 4 : TMPL_IF login_page start ### HTML::Template Debug ### /templates/background.tpl : line 5 : INCLUDE login_page.tpl ### HTML::Template Debug ### /templates/background.tpl : line 5 : /TMPL_IF end ### HTML::Template _param Stack Dump ### bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o = undef)}, 'HTML::Template::NOOP' ), bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), msg.innerHTML = "Your subscription expires in " + daysTillExpired + " days. " + document.getElementById(\'popupinfo\').innerHTML += " <span style=\\"font-weight: bold; color: #FF0000;\\">Dual Windows disabled due to popup blocker.</span>"; _javarow.innerHTML = _html; r.innerHTML = "<font color=red " + fSize + "><b>" + t + "</b></font>" + addedTxt; c.innerHTML = "<b>Event Name:</b>" + sText; c.innerHTML=""; ### HTML::Template Cache Debug ### CACHE LOAD : /templates/background.tpl => a3b4215ada4a08b236710034cb1dd9c3 ### HTML::Template Debug ### In output ### HTML::Template output Stack Dump ### bless( do{\(my $o = 1)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), bless( do{\(my $o = '<!DOCTYPE HTML PUBLIC \'-//W3C//DTD HTML 4.01 Transitional//EN\' \'http://www.w3.org/TR/html4/loose.dtd\'> <td>')}, 'HTML::Template::VAR' ), bless( do{\(my $o = '1')}, 'HTML::Template::VAR' ), bless( do{\(my $o = 'Traders International')}, 'HTML::Template::VAR' ), </html>')}, 'HTML::Template::VAR' ), bless( do{\(my $o = undef)}, 'HTML::Template::NOOP' ), bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), msg.innerHTML = "Your subscription expires in " + daysTillExpired + " days. " + document.getElementById(\'popupinfo\').innerHTML += " <span style=\\"font-weight: bold; color: #FF0000;\\">Dual Windows disabled due to popup blocker.</span>"; _javarow.innerHTML = _html; r.innerHTML = "<font color=red " + fSize + "><b>" + t + "</b></font>" + addedTxt; c.innerHTML = "<b>Event Name:</b>" + sText; c.innerHTML=""; **** attempt #2 ****** ### HTML::Template Debug ### In _parse: ### HTML::Template Debug ### /templates/background.tpl : line 1 : TMPL_IF login_menu start ### HTML::Template Debug ### /templates/background.tpl : line 2 : INCLUDE login_menu.tpl ### HTML::Template Debug ### /templates/login_menu.tpl : line 1 : parsed VAR header ### HTML::Template Debug ### /templates/login_menu.tpl : line 13 : parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 17 : parsed VAR companyname ### HTML::Template Debug ### /templates/login_menu.tpl : line 22 : parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 23 : parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 31 : parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 32 : parsed VAR companyid ### HTML::Template Debug ### /templates/login_menu.tpl : line 35 : parsed VAR footer ### HTML::Template Debug ### /templates/background.tpl : line 2 : /TMPL_IF end ### HTML::Template Debug ### /templates/background.tpl : line 4 : TMPL_IF login_page start ### HTML::Template Debug ### /templates/background.tpl : line 5 : INCLUDE login_page.tpl ### HTML::Template Debug ### /templates/background.tpl : line 5 : /TMPL_IF end ### HTML::Template _param Stack Dump ### bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), bless( do{\(my $o = undef)}, 'HTML::Template::NOOP' ), bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), msg.innerHTML = "Your subscription expires in " + daysTillExpired + " days. " + document.getElementById(\'popupinfo\').innerHTML += " <span style=\\"font-weight: bold; color: #FF0000;\\">Dual Windows disabled due to popup blocker.</span>"; _javarow.innerHTML = _html; r.innerHTML = "<font color=red " + fSize + "><b>" + t + "</b></font>" + addedTxt; c.innerHTML = "<b>Event Name:</b>" + sText; c.innerHTML=""; ### HTML::Template Cache Debug ### CACHE LOAD : /templates/background.tpl => a3b4215ada4a08b236710034cb1dd9c3 ### HTML::Template Debug ### In output ### HTML::Template output Stack Dump ### bless( do{\(my $o = 1)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), bless( do{\(my $o = '<!DOCTYPE HTML PUBLIC \'-//W3C//DTD HTML 4.01 Transitional//EN\' \'http://www.w3.org/TR/html4/loose.dtd\'> <td>')}, 'HTML::Template::VAR' ), bless( do{\(my $o = '26')}, 'HTML::Template::VAR' ), bless( do{\(my $o = 'TradingZoo')}, 'HTML::Template::VAR' ), </html>')}, 'HTML::Template::VAR' ), bless( do{\(my $o = undef)}, 'HTML::Template::NOOP' ), bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), msg.innerHTML = "Your subscription expires in " + daysTillExpired + " days. " + document.getElementById(\'popupinfo\').innerHTML += " <span style=\\"font-weight: bold; color: #FF0000;\\">Dual Windows disabled due to popup blocker.</span>"; _javarow.innerHTML = _html; r.innerHTML = "<font color=red " + fSize + "><b>" + t + "</b></font>" + addedTxt; c.innerHTML = "<b>Event Name:</b>" + sText; c.innerHTML=""; ******* attempt #3 ****** ### HTML::Template Cache Debug ### CACHE HIT : /some/path//pages/sctest/templates/background.tpl => a3b4215ada4a08b236710034cb1dd9c3 ### HTML::Template Debug ### In output ### HTML::Template output Stack Dump ### bless( do{\(my $o = 1)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), bless( do{\(my $o = '<!DOCTYPE HTML PUBLIC \'-//W3C//DTD HTML 4.01 Transitional//EN\' \'http://www.w3.org/TR/html4/loose.dtd\'> <td>')}, 'HTML::Template::VAR' ), bless( do{\(my $o = '1')}, 'HTML::Template::VAR' ), bless( do{\(my $o = 'Traders International')}, 'HTML::Template::VAR' ), </html>')}, 'HTML::Template::VAR' ), bless( do{\(my $o = undef)}, 'HTML::Template::NOOP' ), bless( do{\(my $o = undef)}, 'HTML::Template::VAR' ), ], 'HTML::Template::COND' ), msg.innerHTML = "Your subscription expires in " + daysTillExpired + " days. " + document.getElementById(\'popupinfo\').innerHTML += " <span style=\\"font-weight: bold; color: #FF0000;\\">Dual Windows disabled due to popup blocker.</span>"; _javarow.innerHTML = _html; r.innerHTML = "<font color=red " + fSize + "><b>" + t + "</b></font>" + addedTxt; c.innerHTML = "<b>Event Name:</b>" + sText; c.innerHTML=""; |
From: Paulsen, B. <BPa...@le...> - 2006-03-07 14:09:31
|
I use Apache::Registry (this has likely been replaced by the ModPerl::Registry that you mention) The scripts do get compiled and stored in memory and it's exactly what you want. It sounds to me that you are writing the output to a file and then redirecting to that file. I do not have the "+ParseHeaders" option set, and that might be the difference. Perhaps the ParseHeaders is setting invalid caching tags. =20 The best thing to do in this example is use a text client (such as lwp-request) to run the script and have it output the entire string (headers and all). It should hopefully be very apparent where the problem is. The main difference between ModPerl::PerlRun and ModPerl::Registry is that ModPerl::PerlRun still exits after every call to the script. In other words, the only thing you are saving is the module compilation time (this can still be significant). If you are not including those modules in an apache startup script, you are not even saving that. You definitly have enough of the .so modules installed. I consider "full-blown" to mean that you are using ModPerl::Registry. If you can track down and fix that caching issues, you should notice a huge improvement in speed. Brian=20 -----Original Message----- =46rom: htm...@li... [mailto:htm...@li...] On Behalf Of Matthew Boehm Sent: Tuesday, March 07, 2006 9:00 AM To: htm...@li... Subject: RE: [htmltmpl] mod_perl usage > I have no experience of ModPerl::PerlRun. How then are you running ModPerl=3F My apache conf contains this which activates mod_perl for a specific directory on our web server: <Directory /home/me/public_html/pages/sc2/> Options +ExecCGI <FilesMatch "\.cgi$"> SetHandler perl-script PerlResponseHandler ModPerl::PerlRun PerlOptions +ParseHeaders </FilesMatch> </Directory> > Make sure it is not you browser that is caching the page as a first off. I've disabled cache on the browsers and tried different browsers on different OSes. Same 'caching' behavior from the template module. > How does ModPerl::PerlRun work=3F I don't even begin to pretend to know anything about mod_perl, but =66rom the docs "ModPerl::PerlRun - Run unaltered CGI scripts under mod_perl". If you use ModPerl::Registry, the docs say quite outright that your script gets compiled and stored in memory. We discovered this during our first attempts at modperl. Using Registry, our main CGI results would get cached using our own template model. So we switched to PerlRun and the caching stopped. Now I'm trying to use a template and the caching is back even though nothing else has changed in our setup. It was my understanding that mod_perl does nothing for you unless you 'activate' it for a directory/vhost like I did above. > Also, you should see if you can get a full blown mod_perl server running. Here is our server: Server version: Apache/2.0.55 Server built: Oct 23 2005 13:44:20 Compiled in modules: core.c mod_perl.c prefork.c http_core.c mod_so.c Is that full-blown enough=3F Thanks, Matthew ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel=3Fcmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 _______________________________________________ Html-template-users mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/html-template-users ---------------------------------------------------------------------------= --- This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended recipient= = of this message you are hereby notified that any review, dissemination, = distribution or copying of this message is strictly prohibited. This = communication is for information purposes only and should not be regarded a= s= an offer to sell or as a solicitation of an offer to buy any financial = product, an official confirmation of any transaction, or as an official = statement of Lehman Brothers. Email transmission cannot be guaranteed to b= e= secure or error-free. Therefore, we do not represent that this informatio= n= is complete or accurate and it should not be relied upon as such. All = information is subject to change without notice. |
From: Matthew B. <dr...@ma...> - 2006-03-07 14:00:15
|
> I have no experience of ModPerl::PerlRun. How then are you running ModPerl? My apache conf contains this which activates mod_perl for a specific directory on our web server: <Directory /home/me/public_html/pages/sc2/> Options +ExecCGI <FilesMatch "\.cgi$"> SetHandler perl-script PerlResponseHandler ModPerl::PerlRun PerlOptions +ParseHeaders </FilesMatch> </Directory> > Make sure it is not you browser that is caching the page as a first off. I've disabled cache on the browsers and tried different browsers on different OSes. Same 'caching' behavior from the template module. > How does ModPerl::PerlRun work? I don't even begin to pretend to know anything about mod_perl, but from the docs "ModPerl::PerlRun - Run unaltered CGI scripts under mod_perl". If you use ModPerl::Registry, the docs say quite outright that your script gets compiled and stored in memory. We discovered this during our first attempts at modperl. Using Registry, our main CGI results would get cached using our own template model. So we switched to PerlRun and the caching stopped. Now I'm trying to use a template and the caching is back even though nothing else has changed in our setup. It was my understanding that mod_perl does nothing for you unless you 'activate' it for a directory/vhost like I did above. > Also, you should see if you can get a full blown mod_perl server running. Here is our server: Server version: Apache/2.0.55 Server built: Oct 23 2005 13:44:20 Compiled in modules: core.c mod_perl.c prefork.c http_core.c mod_so.c Is that full-blown enough? Thanks, Matthew |
From: Paulsen, B. <BPa...@le...> - 2006-03-07 12:17:31
|
I did. I'll dig it up to share again. Brian=20 -----Original Message----- =46rom: Bodo Schulze [mailto:bo...@le...]=20 Sent: Tuesday, March 07, 2006 6:57 AM To: Paulsen, Brian Cc: htm...@li... Subject: Re: [htmltmpl] Usage question Brian Paulsen wrote; > If it helps, I wrote a filter that takes a Dreamweaver template file=20 > and conv erted it to a HTML::Template file. This allowed the=20 > Dreamweaver savvy design er to test out modifications with the template there. Would be great if you shared this filter. Bodo ---------------------------------------------------------------------------= --- This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended recipient= = of this message you are hereby notified that any review, dissemination, = distribution or copying of this message is strictly prohibited. This = communication is for information purposes only and should not be regarded a= s= an offer to sell or as a solicitation of an offer to buy any financial = product, an official confirmation of any transaction, or as an official = statement of Lehman Brothers. Email transmission cannot be guaranteed to b= e= secure or error-free. Therefore, we do not represent that this informatio= n= is complete or accurate and it should not be relied upon as such. All = information is subject to change without notice. |
From: Bodo S. <bo...@le...> - 2006-03-07 11:47:50
|
Brian Paulsen wrote; > If it helps, I wrote a filter that takes a Dreamweaver template file and conv > erted it to a HTML::Template file. This allowed the Dreamweaver savvy design > er to test out modifications with the template there. Would be great if you shared this filter. Bodo |
From: Paulsen, B. <BPa...@le...> - 2006-03-07 11:35:50
|
If it helps, I wrote a filter that takes a Dreamweaver template file and = converted it to a HTML::Template file. This allowed the Dreamweaver savvy = designer to test out modifications with the template there. ---- Original Message ---- =46rom: "Matias Alejo Garcia" <ma...@ni...> Date: 3/6/06 10:17 am To: "htm...@li..." = <htm...@li...> Subj: [htmltmpl] Usage question On 3/6/06, Michael Peters <mp...@pl... = <mailto:mp...@pl...> > wrote: Mark A. Fuller wrote: =09 > If you want to give the designer the actual templates (but not require = her to install the entire application), you could write a little script tha= t= would load each template, set variables and ->output() it to a file. = Something like a script to run through some test cases (generate the page = with the user logged in, not logged in, with an error message, with a = success message, with the "you have mail" indicator set, etc.). This way th= e= designer could change the template and regenerate some HTML (without = actually using the entire application).=20 =09 One idea that did cross my mind is to create a small web application that = simply fills in some default values to the templates. It should also allow any parameters to be overridden by the query string. Then if the designer is = capable=20 he/she could just play with the url to see what different states look like. They could also use something like Firefox + Tamper Data to even make it = easier. =09 Might be overkill but if you did it right it could be reuseable for = different=20 projects. Thank you for your suggestion! For now, I will give the designer a couple= = of frozen sets of parameters (stored by 'Storable') and a little applicatio= n= to fill the templates.=20 he problem is that many parameters are LOOPs, so it will be difficult to se= t= them by the query string.=20 Mat=EDas --=20 Mat=EDas Alejo Garc=EDa | http://www.nits.com.ar = <http://www.nits.com.ar>=20 ---------------------------------------------------------------------------= --- This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended recipient= = of this message you are hereby notified that any review, dissemination, = distribution or copying of this message is strictly prohibited. This = communication is for information purposes only and should not be regarded a= s= an offer to sell or as a solicitation of an offer to buy any financial = product, an official confirmation of any transaction, or as an official = statement of Lehman Brothers. Email transmission cannot be guaranteed to b= e= secure or error-free. Therefore, we do not represent that this informatio= n= is complete or accurate and it should not be relied upon as such. All = information is subject to change without notice. |
From: Paulsen, B. <BPa...@le...> - 2006-03-07 11:25:56
|
Can you have your script output something to the error log when it is run= =3F= I suspect that something is not properly configured on your server and it= = is setting invalid cache control headers on your output. It almost sounds = like the apache server thinks it is serving up a file rather than a script. Also, you should see if you can get a full blown mod_perl server running. = While PHP may still be faster, the difference should be negligible. A real= = mod_perl server is lightning fast. ---- Original Message ---- =46rom: "Matthew Boehm" <dr...@ma...> Date: 3/7/06 12:10 am To: "htm...@li..." = <htm...@li...> Subj: [htmltmpl] mod_perl usage Hey guys, I tried to register to the list but SF never replied back to me; so if anyone replies, I'd appreciate a CC: We use mod_perl in the format of ModPerl::PerlRun. We run only one cgi (our main app) that loads HTML pages via simple file open and uses a crude search/replace as our 'template' system. I've been trying various perl template engines (like HTML::Template and CGI::FastTemplate). Unfortunatly, due to some unknow reason, both template packages are returning cached versions of our HTML. For example, many of our CGI calls follow this pattern: http://www.ourdomain.com/cgi-bin/jefferson.cgi=3FcompanyID=3DXXXX Where XXXX is any one of our several thousand customer numbers. The only differences in the pages produced by the CGI are customer name, address, logo, etc..pulled from database. The problem in my testing has been thus: I access the URL above with ID 4035 and I get the correct info of company #4035. I then access the same URL but change the ID to 2134. Even though the URL shows 2134, the page displays content for 4035. I am forced to hit refresh on my browser several times before seeing 2134's info. I've explicitly turned off the caching feature of HTML::Template, yet I experience the same as above. Since our main app is Perl based, having mod_perl greatly increases our preformance. But it seems that using mod_perl prevents us from using a template system other than our own. (I had the same experience with CGI::FastTemplate) Can anyone shed some light on this=3F I am tempted to just rewrite our CGI into PHP as PHP executes faster than Perl even with mod_perl and I don't get this caching problem. But that will take time. Can anyone shed some light on my situation=3F I am not familiar with mod_perl at all, so if we are indeed running that portion poorly assistance there would be appreciated as well. Thanks, Matthew ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel=3Fcmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 _______________________________________________ Html-template-users mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/html-template-users ---------------------------------------------------------------------------= --- This message is intended only for the personal and confidential use of the = designated recipient(s) named above. If you are not the intended recipient= = of this message you are hereby notified that any review, dissemination, = distribution or copying of this message is strictly prohibited. This = communication is for information purposes only and should not be regarded a= s= an offer to sell or as a solicitation of an offer to buy any financial = product, an official confirmation of any transaction, or as an official = statement of Lehman Brothers. Email transmission cannot be guaranteed to b= e= secure or error-free. Therefore, we do not represent that this informatio= n= is complete or accurate and it should not be relied upon as such. All = information is subject to change without notice. |
From: Matthew B. <dr...@ma...> - 2006-03-07 05:09:31
|
Hey guys, I tried to register to the list but SF never replied back to me; so if anyone replies, I'd appreciate a CC: We use mod_perl in the format of ModPerl::PerlRun. We run only one cgi (our main app) that loads HTML pages via simple file open and uses a crude search/replace as our 'template' system. I've been trying various perl template engines (like HTML::Template and CGI::FastTemplate). Unfortunatly, due to some unknow reason, both template packages are returning cached versions of our HTML. For example, many of our CGI calls follow this pattern: http://www.ourdomain.com/cgi-bin/jefferson.cgi?companyID=XXXX Where XXXX is any one of our several thousand customer numbers. The only differences in the pages produced by the CGI are customer name, address, logo, etc..pulled from database. The problem in my testing has been thus: I access the URL above with ID 4035 and I get the correct info of company #4035. I then access the same URL but change the ID to 2134. Even though the URL shows 2134, the page displays content for 4035. I am forced to hit refresh on my browser several times before seeing 2134's info. I've explicitly turned off the caching feature of HTML::Template, yet I experience the same as above. Since our main app is Perl based, having mod_perl greatly increases our preformance. But it seems that using mod_perl prevents us from using a template system other than our own. (I had the same experience with CGI::FastTemplate) Can anyone shed some light on this? I am tempted to just rewrite our CGI into PHP as PHP executes faster than Perl even with mod_perl and I don't get this caching problem. But that will take time. Can anyone shed some light on my situation? I am not familiar with mod_perl at all, so if we are indeed running that portion poorly assistance there would be appreciated as well. Thanks, Matthew |
From: Matias A. G. <ma...@ni...> - 2006-03-06 15:16:33
|
On 3/6/06, Michael Peters <mp...@pl...> wrote: > > > > Mark A. Fuller wrote: > > > If you want to give the designer the actual templates (but not require > her to install the entire application), you could write a little script t= hat > would load each template, set variables and ->output() it to a file. > Something like a script to run through some test cases (generate the page > with the user logged in, not logged in, with an error message, with a > success message, with the "you have mail" indicator set, etc.). This way = the > designer could change the template and regenerate some HTML (without > actually using the entire application). > > One idea that did cross my mind is to create a small web application that > simply > fills in some default values to the templates. It should also allow any > parameters to be overridden by the query string. Then if the designer is > capable > he/she could just play with the url to see what different states look > like. > They could also use something like Firefox + Tamper Data to even make it > easier. > > Might be overkill but if you did it right it could be reuseable for > different > projects. Thank you for your suggestion! For now, I will give the designer a couple of frozen sets of parameters (stored by 'Storable') and a little applicatio= n to fill the templates. he problem is that many parameters are LOOPs, so it will be difficult to se= t them by the query string. Mat=EDas -- Mat=EDas Alejo Garc=EDa | http://www.nits.com.ar |
From: Michael P. <mp...@pl...> - 2006-03-06 14:12:29
|
Mark A. Fuller wrote: > If you want to give the designer the actual templates (but not require her to install the entire application), you could write a little script that would load each template, set variables and ->output() it to a file. Something like a script to run through some test cases (generate the page with the user logged in, not logged in, with an error message, with a success message, with the "you have mail" indicator set, etc.). This way the designer could change the template and regenerate some HTML (without actually using the entire application). One idea that did cross my mind is to create a small web application that simply fills in some default values to the templates. It should also allow any parameters to be overridden by the query string. Then if the designer is capable he/she could just play with the url to see what different states look like. They could also use something like Firefox + Tamper Data to even make it easier. Might be overkill but if you did it right it could be reuseable for different projects. -- Michael Peters Developer Plus Three, LP |
From: Matias A. G. <ma...@ni...> - 2006-03-06 11:29:55
|
Thanks you for your answers! On 3/6/06, Sam Tregar <sa...@tr...> wrote: > > On Sun, 5 Mar 2006, Matias Alejo Garcia wrote: > > Is there any way to, once the $template is filled, to dump the variable= s > to > > a file? > Sure. The full parameter set is available via param(): > my %data =3D map { ($_, $template->param($_) } $template->param(); > You can dump that hash to a file with Storable or Data::Dumper, just > like any other Perl file. Great! Thanks! That was what I was looking for! Alterantely, you can use Storable on the HTML::Template object itself. > This is guaranteed to work since this is how HTML::Template implements > file_cache mode. with this solution the template itself will be stored (I mean, not only the parameters), ok? Thanks! mat=EDas -- Mat=EDas Alejo Garc=EDa | http://www.nits.com.ar |
From: Sam T. <sa...@tr...> - 2006-03-06 06:53:58
|
On Sun, 5 Mar 2006, Matias Alejo Garcia wrote: > Is there any way to, once the $template is filled, to dump the variables to > a file? Sure. The full parameter set is available via param(): my %data = map { ($_, $template->param($_) } $template->param(); You can dump that hash to a file with Storable or Data::Dumper, just like any other Perl file. Alterantely, you can use Storable on the HTML::Template object itself. This is guaranteed to work since this is how HTML::Template implements file_cache mode. -sam |
From: Mark A. F. <mar...@ea...> - 2006-03-06 03:11:51
|
From: Matias Alejo Garcia <ma...@ni...> > >Is there any way to, once the $template is filled, to dump the variables to >a file? I may not understand this correctly. But, you can print your $template->output() to a file (instead of STDOUT). Give essentially static HTML to the designer. She'd have to open each one individually. You just "print FH $template->output()". If you want to do some preprocessing like change the CSS link to a disk file instead of an HTTP link you can do something like "my $html = $template->output()" and do a "$html =~ s/<whatever>/<something>/". Then print the $html variable to a file. If you want to give the designer the actual templates (but not require her to install the entire application), you could write a little script that would load each template, set variables and ->output() it to a file. Something like a script to run through some test cases (generate the page with the user logged in, not logged in, with an error message, with a success message, with the "you have mail" indicator set, etc.). This way the designer could change the template and regenerate some HTML (without actually using the entire application). Mark |
From: Matias A. G. <ma...@ni...> - 2006-03-06 00:35:55
|
hello all! I am new in the list, I have been using HTML::Template for 3 month! great work!! I would like to ask for your suggestion for the following problem: We have a complex web application using HTML::Template. This application uses MySQL and a lot of modules, and is not easy to install. We need a HTML designer to work in the templates. Is there any way to, once the $template is filled, to dump the variables to a file? the idea is to give the designer all the templates and the CSS's and a simple application that 1) reads the dumped file 2) fill the templates 3) output html so, he will be able to work in the templates, and see how they will look, without installing our application. thank you very much!! mat=EDas -- Mat=EDas Alejo Garc=EDa NITS Argentina | http://www.nits.com.ar UADE | Profesor Adjunto | Departamento de Inform=E1tica |
From: Sam T. <sa...@tr...> - 2006-03-04 04:29:46
|
ANNOUNCEMENT: HTML::Template::Expr v0.06 CHANGES - Rewrote grammar to support expressions with less parenthesis. For example, "foo || bar || baz" now works. DESCRIPTION This module provides an extension to HTML::Template which allows expressions in the template syntax. This is purely an addition - all the normal HTML::Template options, syntax and behaviors will still work. Expression support includes comparisons, math operations, string operations and a mechanism to allow you add your own functions at runtime. AVAILABILITY This module is available on SourceForge. Download it at: http://sourceforge.net/project/showfiles.php?group_id=1075 The module is also available on CPAN. You can get it using CPAN.pm or go to: http://search.cpan.org/~samtregar/HTML-Template-Expr/ CONTACT INFO You can join the HTML::Template mailing-list by visiting: http://lists.sourceforge.net/lists/listinfo/html-template-users |
From: Brad C. <bc...@gm...> - 2006-02-28 02:04:08
|
On 2/27/06, Sam Tregar <sa...@tr...> wrote: > On Sat, 25 Feb 2006, Brad Choate wrote: > > First, for filters: a filter should be able to determine what file is > > currently being processed, if the contents of the template did come > > from a file. > > I guess that makes sense. I'm curious though - what are you planning > to do with this feature? One of MT's biggest features is our plugin support. With an upcoming release, plugins will be able to make changes to the application's templates. To do this, the plugins can request to be notified when processing a particular template. Ie, the "menu" template. There are others though, such as the common header and footer templates that they can also target, but these are pulled in through the TMPL_INCLUDE tag. I can use the HTML::Template filter parameter to know when the includes are processed, but I don't know what filename is being loaded at the time. > > Second, for template vars that are coderefs. > > > > To me, these are a bit limited since the coderef has no way to > > determine it's context. I'm envisioning a scenario like this: > > > > <TMPL_LOOP NAME=3DX> > > <TMPL_VAR NAME=3DCODE_FOO> > > </TMPL_LOOP> > > > > The coderef associated with 'code_foo' is called for each iteration of > > the array in parameter 'x', but 'code_foo' has no way to access the > > active row of data. > > This seems less obviously useful to me. If the data-structure for > loop X is so complicated then why make it more complicated by using > code-refs? Why not just bake it all into the structure you pass to > param() in the first place? > > I should admit, I very rarely use code-ref params in my work. They > seem to have a very limited utility. I used them to implement > HTML::Template::Expr, but I wouldn't say I'm proud of that fact! I don't use them either-- I just found out HTML::Template supported them! I just find it odd that the coderef has no means to determine the context in which it was invoked. Perhaps if it could, it would be more useful? The current implementation seems to be just enough implementation to support HTML::Template::Expr and nothing more. |