CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Advanced:
HTML::Pager HTML::Template

 



dalehend
stranger

Feb 5, 2001, 2:00 AM

Post #1 of 2 (913 views)
HTML::Pager HTML::Template Can't Post

Anyone familiar with these mods?
The error msg from the script is "Cannot open HTML template?"

Here is the offending lines of code:
use HTML::Pager;
use HTML::Template;
my $search_template = HTML::Template->new(filename => 'csvsearch.tmpl');

my $query_page = CGI->new();


my $get_data_sub = sub {

my @return_array;
for(my $w=0;$w<=(@good -1);$w=$w+1){

my @m_entries=split(",",$csv_lines[$good[$w]]);

push(@return_array, {sku=>chomp($m_entries[1]),
desc=>chomp($m_entries[2]),
list=>chomp($m_entries[3]),
price=>chomp($m_entries[4]) });

};
open SAVE, ">save_return_array.dmp";
print SAVE Data::Dumper->Dump([@return_array], ['return_array']);
close SAVE;

return \@return_array;
};

my $pager = HTML::Pager->new(
# required parameters
query => $query_page,
get_data_callback => $get_data_sub, # pass the hits array to get number of rows and offset
rows => @good, #
page_size => 3, #final production should be 25
# some optional parameters
# some optional parameters
persist_vars => ['sku',
'list',
'desc',
'price'],

cell_space_color => '#000000',
cell_background_color => '#ffffff',
nav_background_color => '#dddddd',
debug => 1,
template=> $search_template );





RFQ Project Developer


unknownSym
stranger

Feb 15, 2001, 6:09 AM

Post #2 of 2 (895 views)
Re: HTML::Pager HTML::Template [In reply to] Can't Post

I haven't worked with HTML::Template for some time now, but I believe the offending line of code is "my $search_template = HTML::Template->new(filename => 'csvsearch.tmpl');" I would check the file permissions for the 'csvsearch.tmpl' (if you're running a Unix-variant system) and/or check to make sure that file path is correct. Currently the script is searching for the file in the directory that script resides in.

If neither of these work then I suggest opening up either of the two modules and searching for that error message. You can learn neat things that way.

--unknownSym


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives