html-template-users Mailing List for HTML::Template (Page 45)
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: Aleksey S. <al...@ca...> - 2004-07-29 20:04:33
|
>> The reason is "-r $filename" expression - it doesn't work with ACL. ST> Really? Why not? See test in the bottom of my message Regards, Aleksey |
From: Sam T. <sa...@tr...> - 2004-07-29 19:52:24
|
On Thu, 29 Jul 2004, Aleksey Serba wrote: > The reason is "-r $filename" expression - it doesn't work with ACL. Really? Why not? That's the most obvious way to see if a file is readable in Perl. > It's the common perl problem or we could use another expression to > determine readable file or not? Does stat() work? I don't know why stat() would work if -r doesn't... -sam |
From: Aleksey S. <al...@ca...> - 2004-07-29 19:27:48
|
Hello! HTML::Template failed trying to process file with ACL ( can't read _readable_ file ) The reason is "-r $filename" expression - it doesn't work with ACL. It's the common perl problem or we could use another expression to determine readable file or not? What's the best way to fix it? Thanks in advance. Aleksey > uname -a Linux 2.6.7-1-k7 i686 GNU/Linux > mount -l | grep /home /dev/hda2 on /home type ext3 (rw,acl) [] > perl -MHTML::Template -e 'print $HTML::Template::VERSION' 2.7 > pwd /home/hosting/project/cgi-bin/ > cat test.cgi ------------------------------------------ #!/usr/bin/perl use CGI; use HTML::Template; print CGI::header(); print 'Whoami: '.`whoami`; print 'Current Directory: '.`pwd`; print 'Template file: '.`cat test.txt`."\n"; my $template = HTML::Template->new( filename => 'test.txt' ); $template->param( { param1 => 'blah' } ); print "Template output: ".$template->output()."\n"; ------------------------------------------ > cat test.txt ------------------------------------------ <TMPL_VAR NAME="param1"> ------------------------------------------ > getfacl test.txt ------------------------------------------ # file: test.txt # owner: aleksey # group: aleksey user::rw- user:www-data:rwx #effective:rw- group::--- mask::rw- other::--- ------------------------------------------ > ./test.cgi ------------------------------------------ Content-Type: text/html; charset=ISO-8859-1 Whoami: aleksey Current Directory: /home/hosting/project/cgi-bin Template file: <TMPL_VAR NAME="param1"> Template output: blah ------------------------------------------ > lwp-request project.com/cgi-bin/test.cgi ------------------------------------------ Whoami: www-data Current Directory: /home/hosting/project/cgi-bin Template file: <TMPL_VAR NAME="param1"> ------------------------------------------ > tail error.log ------------------------------------------ HTML::Template : template file test.txt does not exist or is unreadable at /usr/local/share/perl/5.8.4/HTML/Template.pm line 1574 \tHTML::Template::_mtime('HTML::Template=HASH(0x82214a0)', 'test.txt') called at /usr/local/share/perl/5.8.4/HTML/Template.pm line 1624 \tHTML::Template::_init_template('HTML::Template=HASH(0x82214a0)') called at /usr/local/share/perl/5.8.4/HTML/Template.pm line 1189 \tHTML::Template::_init('HTML::Template=HASH(0x82214a0)') called at /usr/local/share/perl/5.8.4/HTML/Template.pm line 1083 \tHTML::Template::new('HTML::Template', 'filename', 'test.txt') called at /home/hosting/others/e3e5.com/cgi-bin/test.cgi line 9 ------------------------------------------ > su www-data > cat test.txt <TMPL_VAR NAME="param1"> > perl -e '$filepath="./test.txt"; (-r $filepath) or print "Error" ' Error |
From: Sam T. <sa...@tr...> - 2004-07-29 19:08:54
|
On Thu, 29 Jul 2004, Nicholas R. Markham wrote: > Oops, I guess I confused the file with another log.txt in a different directory. > (That'll teach me to use such generic file names.) Attached should be the > *real* log, which is fairly interesting in its own right. Well, it looks like all the tests are passing to me. Maybe your Test::Harness is broken? You might try updating it from CPAN. If you don't feel like debugging further I think can safely do a 'make install'. -sam |
From: Nicholas R. M. <ma...@rp...> - 2004-07-29 18:58:42
|
Oops, I guess I confused the file with another log.txt in a different directory. (That'll teach me to use such generic file names.) Attached should be the *real* log, which is fairly interesting in its own right. > -----Original Message----- > From: Sam Tregar [mailto:sa...@tr...] > Sent: Thursday, July 29, 2004 2:52 PM > To: Nicholas R. Markham > Cc: htm...@li... > Subject: RE: [htmltmpl] tests fail using Perl 5.6.1 > > On Thu, 29 Jul 2004, Nicholas R. Markham wrote: > > > perl -v > > > > This is perl, v5.6.1 built for i386-linux > > > > perl -Mblib -MHTML::Template -e 1 > > > > Using /misc/home/users/markhn/HTML-Template-2.7/blib > > Well, that looks fine. I have no idea why running the test > script outputs a log of your working hours. Are you sure you > sent me the right log.txt? The one I got started: > > Hours unreported: 0 > Hours unpaid: 31.5 > > -sam |
From: Sam T. <sa...@tr...> - 2004-07-29 18:52:18
|
On Thu, 29 Jul 2004, Nicholas R. Markham wrote: > perl -v > > This is perl, v5.6.1 built for i386-linux > > perl -Mblib -MHTML::Template -e 1 > > Using /misc/home/users/markhn/HTML-Template-2.7/blib Well, that looks fine. I have no idea why running the test script outputs a log of your working hours. Are you sure you sent me the right log.txt? The one I got started: Hours unreported: 0 Hours unpaid: 31.5 -sam |
From: Nicholas R. M. <ma...@rp...> - 2004-07-29 18:50:22
|
perl -v This is perl, v5.6.1 built for i386-linux Copyright 1987-2001, Larry Wall Perl may be copied only under the terms of either the Artistic License or the GNU General Public License, which may be found in the Perl 5 source kit. Complete documentation for Perl, including FAQ lists, should be found on this system using `man perl' or `perldoc perl'. If you have access to the Internet, point your browser at http://www.perl.com/, the Perl Home Page. perl -Mblib -MHTML::Template -e 1 Using /misc/home/users/markhn/HTML-Template-2.7/blib > -----Original Message----- > From: htm...@li... > [mailto:htm...@li...] On > Behalf Of Sam Tregar > Sent: Thursday, July 29, 2004 2:38 PM > To: Nicholas R. Markham > Cc: htm...@li... > Subject: RE: [htmltmpl] tests fail using Perl 5.6.1 > > On Thu, 29 Jul 2004, Nicholas R. Markham wrote: > > > It gets odder... > > > > The output of the command you requested is attached. > > You must be kidding! Or something incredibly weird is > happenning on your system. What does this return: > > perl -v > > And how about this: > > perl -Mblib -MHTML::Template -e 1 > > -sam |
From: Sam T. <sa...@tr...> - 2004-07-29 18:37:50
|
On Thu, 29 Jul 2004, Nicholas R. Markham wrote: > It gets odder... > > The output of the command you requested is attached. You must be kidding! Or something incredibly weird is happenning on your system. What does this return: perl -v And how about this: perl -Mblib -MHTML::Template -e 1 -sam |
From: Nicholas R. M. <ma...@rp...> - 2004-07-29 18:31:10
|
It gets odder... The output of the command you requested is attached. > -----Original Message----- > From: Sam Tregar [mailto:sa...@tr...] > Sent: Thursday, July 29, 2004 2:27 PM > To: Nicholas R. Markham > Cc: htm...@li... > Subject: Re: [htmltmpl] tests fail using Perl 5.6.1 > > On Thu, 29 Jul 2004, Nicholas R. Markham wrote: > > > t/99-old-test-pl....FAILED tests 1-70 > > > Failed 70/70 tests, 0.00% okay > > Failed Test Status Wstat Total Fail Failed List of Failed > > > -------------------------------------------------------------- > ---------- > > t/99-old-test-pl.t 70 70 100.00% 1-70 > > Failed 1/1 test scripts, 0.00% okay. 70/70 subtests failed, > 0.00% okay. > > That's odd. Can you run this command and send me the output: > > make test TEST_FILES=t/99-old-test-pl.t TEST_VERBOSE=1 > > Thanks, > -sam |
From: Sam T. <sa...@tr...> - 2004-07-29 18:26:47
|
On Thu, 29 Jul 2004, Nicholas R. Markham wrote: > t/99-old-test-pl....FAILED tests 1-70 > Failed 70/70 tests, 0.00% okay > Failed Test Status Wstat Total Fail Failed List of Failed > ------------------------------------------------------------------------ > t/99-old-test-pl.t 70 70 100.00% 1-70 > Failed 1/1 test scripts, 0.00% okay. 70/70 subtests failed, 0.00% okay. That's odd. Can you run this command and send me the output: make test TEST_FILES=t/99-old-test-pl.t TEST_VERBOSE=1 Thanks, -sam |
From: Nicholas R. M. <ma...@rp...> - 2004-07-29 18:08:07
|
I'm using Perl 5.6.1 on Linux, and when I try to install HTML::Template 2.7, all 70 tests failed. After doing "perl Makefile.PL PREFIX=~/perl", "make" and "make test" I got the following output: t/99-old-test-pl....FAILED tests 1-70 Failed 70/70 tests, 0.00% okay Failed Test Status Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------ t/99-old-test-pl.t 70 70 100.00% 1-70 Failed 1/1 test scripts, 0.00% okay. 70/70 subtests failed, 0.00% okay. Can anyone shed some light on this? Thanks. Nick Markham ma...@rp... |
From: Kapoor, N. <nis...@xc...> - 2004-07-23 15:09:25
|
Hello List, I have this small piece of code here that I am trying to use to create a = nested loop, and I am totally stuck! Would greatly appreciate some help. Thanks, Nishi --------------- start - code -------------------- #!/usr/bin/perl -w # Requires use strict; use HTML::Template; my $txt =3D " <tmpl_loop cLoop> Cat: <tmpl_var cId>, <tmpl_var cTitle> <tmpl_loop scLoop> SubCat: <tmpl_var scId>, <tmpl_var scTitle> </tmpl_loop scLoop> </tmpl_loop cLoop> "; my $tmpl =3D HTML::Template->new(scalarref =3D> \$txt); my @data =3D ( {cId =3D> 'c01_id', cTitle =3D> 'c01_title', scId =3D> 'sc01_id', scTitle =3D> 'sc01_title', }, {cId =3D> 'c01_id', cTitle =3D> 'c01_title', scId =3D> 'sc02_id', scTitle =3D> 'sc02_title', }, {cId =3D> 'c02_id', cTitle =3D> 'c02_title',=20 scId =3D> '', scTitle =3D> '', }, {cId =3D> 'c03_id', cTitle =3D> 'c03_title', scId =3D> 'sc03_id', scTitle =3D> 'sc03_title', }, ); my @cLoop=3D(); my @scLoop=3D(); my $prevCid=3D''; foreach my $rec (sort {$a->{cId} cmp $b->{cId}} @data) { next if (!$rec->{scId}); #skip recs that don't have scId my %cRow; if ($rec->{cId} ne $prevCid) { $cRow{cId}=3D$rec->{cId}; $cRow{cTitle}=3D$rec->{cTitle}; } my %scRow; $scRow{scId}=3D$rec->{scId}; = $scRow{scTitle}=3D$rec->{scTitle}; push(@scLoop, \%scRow); $cRow{scLoop} =3D \@scLoop if ($rec->{cId} ne $prevCid); push(@cLoop, \%cRow) if ($rec->{cId} ne $prevCid); $prevCid =3D $rec->{cId}; } $tmpl->param(cLoop =3D> \@cLoop); print $tmpl->output; exit; --------------- end - code -------------------- The output I am getting is: Cat: c01_id, c01_title SubCat: sc01_id, sc01_title SubCat: sc02_id, sc02_title SubCat: sc03_id, sc03_title Cat: c03_id, c03_title SubCat: sc01_id, sc01_title SubCat: sc02_id, sc02_title SubCat: sc03_id, sc03_title =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= But, this is what I am hoping to get: Cat: c01_id, c01_title SubCat: sc01_id, sc01_title SubCat: sc02_id, sc02_title Cat: c03_id, c03_title SubCat: sc03_id, sc03_title |
From: Chris F. <cf...@do...> - 2004-07-22 17:41:31
|
Folks, I have a template, example <TMPL_LOOP NAME=3D"SOME_LOOP"> <tr><td><TMPL_VAR NAME=3D"VAL1"></td></tr> </TMPL_LOOP> In my code I have a condition to check and see if I'm even going to = process the loop - in this case the condition is false (loop is not = processed) If ($something eq 'true') { #process some_loop } And the template objects: $content =3D new HTML::Template(filename =3D> "Template1.tmpl"); $content2 =3D new HTML::Template(filename =3D> "Template1.tmpl", associate =3D> = $content, ); Outputting $content is fine, no problems, it comes out as it should = without the "some_loop" having been processed. Output of $content2 results in the error of: HTML::Template::param() : attempt to set parameter 'some_loop' with a = scalar - parameter is not a TMPL_VAR! If I print everything, like: @param names $content{2}->query(); "SOME_LOOP" shows up in both content and content2 If I print the loop, like: @param_names =3D $content{2}->query(loop =3D> 'SOME_LOOP'); Then in both case I get nothing (undef).. Am I missing something?, The name of "some_loop" is unique - This seems = very much like a problem I've had before - but I can't remember any = fix.. Any help would be appreciated.. Thanks -Chris |
From: Peter L. <pe...@pe...> - 2004-07-22 17:21:04
|
We're pleased to announce that Krang SiteMap v1.00 has been released. Krang SiteMap is a Krang add-on for generating robot-friendly sitemaps to aid in Search Engine Optimization. SiteMap is designed to be easily integrated into existing Krang element libraries with minimal work. From the documentation: "The SiteMap element library addon to Krang is designed to make it easier for search robots to crawl your sites. Creating and publishing a SiteMap story at the root category of a site will result in a minimally formatted story listing every published story on the site." Download Krang SiteMap addon from the Krang add-on repository on the Krang website: http://krang.sourceforge.net/ - the Krang Team |
From: Sam T. <sa...@tr...> - 2004-07-21 17:36:56
|
Krang v1.021 is now available. Notable changes in this release: - Krang Data Set (KDS) files may now include any number of Media objects. The previous limit was 32,000. - The new DBHost option allows MySQL to run on a separate machine. - Category templates can be turned off per story type. - Several List and Story searches are now much faster. - More bugs are now fixed. Detailed change-log here: http://krang.sf.net/docs/changelog.html Krang is an Open Source web-publisher / content-management system designed for large-scale magazine-style websites. It is a 100% Perl application using Apache/mod_perl and MySQL, as well as numerous CPAN modules. Krang provides a powerful and easy to use story and media editing environment for magazine editors, as well as a complete template development environment for web designers. On the back-end, Perl programmers can customize Krang to control the data entered in the story editor and add code to drive the templates to build output. Krang can be enhanced with add-ons containing new skins and other new features. Krang easily handles large data sets and can manage multiple websites in a single installation. For more information about Krang, visit the Krang website: http://krang.sourceforge.net/ There you can download Krang, view screenshots, read documentation, join our mailing-lists and access the CVS tree. - the Krang team |
From: Sam T. <sa...@tr...> - 2004-07-14 02:34:39
|
On Wed, 14 Jul 2004, Thilo Planz wrote: > > Does it work if you open() them yourself and pass the filehandle to > > new() instead of the filename? > > I suppose that would work, but I cannot do that for the included > files... Good point. So how do other modules handle this problem? HTML::Template certainly isn't the only module calling open()! Maybe post a question about it on perlmonks.org? -sam |
From: Thilo P. <thi...@we...> - 2004-07-14 02:21:06
|
>> I have a problem with using UFT8-encoded templates. >> The problem seems to be caused by the templates not being open'd() >> with >> the :utf8 flag. > > Does it work if you open() them yourself and pass the filehandle to > new() instead of the filename? I suppose that would work, but I cannot do that for the included files... Thilo |
From: Sam T. <sa...@tr...> - 2004-07-14 02:09:02
|
On Wed, 14 Jul 2004, Thilo Planz wrote: > I have a problem with using UFT8-encoded templates. > The problem seems to be caused by the templates not being open'd() with > the :utf8 flag. Does it work if you open() them yourself and pass the filehandle to new() instead of the filename? -sam |
From: Thilo P. <thi...@we...> - 2004-07-14 01:58:53
|
Hi, I have a problem with using UFT8-encoded templates. The problem seems to be caused by the templates not being open'd() with the :utf8 flag. I can use these templates with HTML::Template just fine, unless I put in template parameters that are Unicode strings. As long as there are no parameters in the template, or the parameters are pure ASCII, Perl does not set the utf8 flag to the output string. This means that string just contains the original bytes, and encoding is not an issue. But once I put Unicode strings into the template, the template output string get upgraded to utf8, with the effect that the bytes in the template (already UTF-8, but that is not known to Perl) are encoded again, which breaks everything. I was able to hot-fix this by including "use open ':utf8';" at the top of the HTML::Template source file. Is there a better way? I am running Perl 5.8.4 (built without any custom settings) on RedHat Enterprise Linux 3. Thanks, Thilo |
From: simran <sim...@re...> - 2004-07-13 23:45:31
|
i think the timeout is only for "some data".. perhaps if you try forking another process (that is attached to the same output handle) that keeps the connection alive by sending some data down the pipe every 30 seconds or so until you are ready to send the final bit of data... that should help... simran. On Wed, 2004-07-14 at 09:19, Mathew Robertson wrote: > > > That looks like a generic IE error message - look at the bottom of > > > the page. It probably has something like - > > > > > > HTTP 500 - Internal server error > > > Internet Explorer > > > > > > My guess is you're timing out before the results can be served up. > > > > Grrr. You are absolutely right. I tried serving the page up in Firefox and > > it works fine. Any idea how to adjust the timeout value for IE? > > AFAIK - there is no way to adjust the timeout. It is one of the reasons reviewers are saying "Firefox renders faster than IE". > > You could try using mod_gzip (assuming that you are using apache) - this may help if your timeout is bandwidth related (eg viewing the page over a modem). > > Mathew > > > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > Html-template-users mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/html-template-users |
From: Mathew R. <mat...@re...> - 2004-07-13 23:21:37
|
> > That looks like a generic IE error message - look at the bottom of > > the page. It probably has something like - > >=20 > > HTTP 500 - Internal server error > > Internet Explorer > >=20 > > My guess is you're timing out before the results can be served up. >=20 > Grrr. You are absolutely right. I tried serving the page up in = Firefox and > it works fine. Any idea how to adjust the timeout value for IE? AFAIK - there is no way to adjust the timeout. It is one of the reasons = reviewers are saying "Firefox renders faster than IE". You could try using mod_gzip (assuming that you are using apache) - this = may help if your timeout is bandwidth related (eg viewing the page over = a modem). Mathew |
From: Tyler H. <Ty...@na...> - 2004-07-13 21:09:57
|
Ragan, Steve wrote: > That looks like a generic IE error message - look at the bottom of > the page. It probably has something like - > > HTTP 500 - Internal server error > Internet Explorer > > My guess is you're timing out before the results can be served up. Grrr. You are absolutely right. I tried serving the page up in Firefox and it works fine. Any idea how to adjust the timeout value for IE? Thanks, Tyler > > Steve Ragan > Sr. Internet Developer > Harris Internet Services > 2500 Westchester Ave. > Purchase, NY 10577 > Phone: 914-641-3948 > Fax : 914-641-3901 > sr...@bc... |
From: Ragan, S. <sr...@bc...> - 2004-07-13 20:13:41
|
That looks like a generic IE error message - look at the bottom of the page. It probably has something like - HTTP 500 - Internal server error Internet Explorer My guess is you're timing out before the results can be served up. Steve Ragan Sr. Internet Developer Harris Internet Services 2500 Westchester Ave. Purchase, NY 10577 Phone: 914-641-3948 Fax : 914-641-3901 sr...@bc... -----Original Message----- From: htm...@li... [mailto:htm...@li...]On Behalf Of Tyler Hepworth Sent: Tuesday, July 13, 2004 3:25 PM To: htm...@li... Subject: [htmltmpl] Is their a maximum amount of data that can be displayed by HTML:: Template? I am using HTML::Template to display software/hardware inventory data being pulled from a database. I have 11 subroutines that pull out data for different categories of data (hardware, os, memory, installed programs, etc) The data is stored in arrays: @rows1 @rows2 ... @rows11 The contents of @rowsX is an array of hashes. The subroutine populates each @rowsX like so: [code] push @rows, { idevice => $idevice, igroup => $igroup, ifield => $ifield, ivalue => $ivalue, }; Once all of my arrays have been populated I then stuff all of it into HTML::Template like this: my @headers = ( {category => 'summary', cat_title => 'Summary', rows1 => \@rows1}, {category => 'cpu', cat_title => 'CPU', rows2 => \@rows2}, {category => 'memory', cat_title => 'Memory', rows3 => \@rows3}, {category => 'os', cat_title => 'Operating System', rows4 => \@rows4}, {category => 'share', cat_title => 'Share', rows5 => \@rows5}, {category => 'lgroup', cat_title => 'Local Groups', rows6 => \@rows6}, {category => 'network', cat_title => 'Windows Network', rows7 => \@rows7}, {category => 'data', cat_title => 'ODBC Data Sources', rows8 => \@rows8}, {category => 'programs', cat_title => 'Installed Programs', rows9 => \@rows9}, {category => 'license', cat_title => 'Licenses', rows10 => \@rows10}, {category => 'environment', cat_title => 'Environment', rows11 => \@rows11} ); $tmpl_cmp_nfo->param( headers => \@headers); This all works beautifully on the majority of my inventories, but I have found a few that will not display. I have built all of the appropriate error checking into my app, but none of those errors display when I come across one of these anomolous inventories. The only thing that shows up in my browser is "page cannot be displayed". I have found that the amount of information contained in an inventory that does not work is substantially larger than the information in one that does work. If I comment out some of the data being retrieved in an anomolous inventory, then it will display as well. Like this: my @headers = ( {category => 'summary', cat_title => 'Summary', rows1 => \@rows1}, {category => 'cpu', cat_title => 'CPU', rows2 => \@rows2}, {category => 'memory', cat_title => 'Memory', rows3 => \@rows3}, #{category => 'os', cat_title => 'Operating System', rows4 => \@rows4}, #{category => 'share', cat_title => 'Share', rows5 => \@rows5}, {category => 'lgroup', cat_title => 'Local Groups', rows6 => \@rows6}, {category => 'network', cat_title => 'Windows Network', rows7 => \@rows7}, {category => 'data', cat_title => 'ODBC Data Sources', rows8 => \@rows8}, {category => 'programs', cat_title => 'Installed Programs', rows9 => \@rows9}, {category => 'license', cat_title => 'Licenses', rows10 => \@rows10}, {category => 'environment', cat_title => 'Environment', rows11 => \@rows11} ); $tmpl_cmp_nfo->param( headers => \@headers); It doesn't matter which of the @rowsX I leave out of the display, I just have to leave some of them out and then it all works. This makes me wonder if there is a limitation to the amount of data that can be displayed by HTML::Template. Any ideas? Thanks, Tyler Hepworth ------------------------------------------------------- This SF.Net email sponsored by Black Hat Briefings & Training. Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com _______________________________________________ Html-template-users mailing list Htm...@li... https://lists.sourceforge.net/lists/listinfo/html-template-users |
From: Tyler H. <Ty...@na...> - 2004-07-13 19:25:14
|
I am using HTML::Template to display software/hardware inventory data being pulled from a database. I have 11 subroutines that pull out data for different categories of data (hardware, os, memory, installed programs, etc) The data is stored in arrays: @rows1 @rows2 ... @rows11 The contents of @rowsX is an array of hashes. The subroutine populates each @rowsX like so: [code] push @rows, { idevice => $idevice, igroup => $igroup, ifield => $ifield, ivalue => $ivalue, }; Once all of my arrays have been populated I then stuff all of it into HTML::Template like this: my @headers = ( {category => 'summary', cat_title => 'Summary', rows1 => \@rows1}, {category => 'cpu', cat_title => 'CPU', rows2 => \@rows2}, {category => 'memory', cat_title => 'Memory', rows3 => \@rows3}, {category => 'os', cat_title => 'Operating System', rows4 => \@rows4}, {category => 'share', cat_title => 'Share', rows5 => \@rows5}, {category => 'lgroup', cat_title => 'Local Groups', rows6 => \@rows6}, {category => 'network', cat_title => 'Windows Network', rows7 => \@rows7}, {category => 'data', cat_title => 'ODBC Data Sources', rows8 => \@rows8}, {category => 'programs', cat_title => 'Installed Programs', rows9 => \@rows9}, {category => 'license', cat_title => 'Licenses', rows10 => \@rows10}, {category => 'environment', cat_title => 'Environment', rows11 => \@rows11} ); $tmpl_cmp_nfo->param( headers => \@headers); This all works beautifully on the majority of my inventories, but I have found a few that will not display. I have built all of the appropriate error checking into my app, but none of those errors display when I come across one of these anomolous inventories. The only thing that shows up in my browser is "page cannot be displayed". I have found that the amount of information contained in an inventory that does not work is substantially larger than the information in one that does work. If I comment out some of the data being retrieved in an anomolous inventory, then it will display as well. Like this: my @headers = ( {category => 'summary', cat_title => 'Summary', rows1 => \@rows1}, {category => 'cpu', cat_title => 'CPU', rows2 => \@rows2}, {category => 'memory', cat_title => 'Memory', rows3 => \@rows3}, #{category => 'os', cat_title => 'Operating System', rows4 => \@rows4}, #{category => 'share', cat_title => 'Share', rows5 => \@rows5}, {category => 'lgroup', cat_title => 'Local Groups', rows6 => \@rows6}, {category => 'network', cat_title => 'Windows Network', rows7 => \@rows7}, {category => 'data', cat_title => 'ODBC Data Sources', rows8 => \@rows8}, {category => 'programs', cat_title => 'Installed Programs', rows9 => \@rows9}, {category => 'license', cat_title => 'Licenses', rows10 => \@rows10}, {category => 'environment', cat_title => 'Environment', rows11 => \@rows11} ); $tmpl_cmp_nfo->param( headers => \@headers); It doesn't matter which of the @rowsX I leave out of the display, I just have to leave some of them out and then it all works. This makes me wonder if there is a limitation to the amount of data that can be displayed by HTML::Template. Any ideas? Thanks, Tyler Hepworth |
From: Sam T. <sa...@tr...> - 2004-07-10 15:45:39
|
On Sat, 10 Jul 2004, Nishikant Kapoor wrote: > I would like to catch this error and do a graceful exit by displaying > "'my.tmpl' not found!" message back to user. Easily done. Just use eval{} to catch the die() and check $@ to examine any error: my $template; eval { $template = HTML::Template->new(filename => 'my.tmpl'); }; if ($@ and $@ =~ /file not found/) { print "my.tmpl not found!"; exit; # or return as appropriate } elsif ($@) { die $@; } -sam |