Hi all,

I'm having some trouble tracking down a bug in some code I've written using
HTML::Template 2.5.  I get this error in my web server log:

Can't call method "isa" on unblessed reference at
/local/lib/perl//HTML/Template.pm line 2364

Line 2346 is in the param method of Template.pm, and I call param in my
output method below, so it seems the problem must lie there.  Can anyone see
obvious problems with my usage?

Thanks!

Phil Brodd


---
package UICMS::HTMLFile;
require Exporter;
@ISA = qw(Exporter);

use strict;
use lib '/local/lib/perl/';
use HTML::Template;
use UICMS::DataTable;


sub new {
    my $self = shift;
    my ($data, $html_template) = @_;
        
    bless {
        _data_table         => $data,
        _html_template        => HTML::Template->new(filename =>
$html_template),
        _template_params    => $self->_init
    }, $self;
}


sub output {
    my $self = shift;
    
    $self->{_html_template}->param(records => \$self->{_template_params});
    return $self->{_html_template}->output;
}


sub _init {
    my $self = shift;
    my $data = shift;
    
    my @loop_data = ();
    
    ## We play only with DataTables
    unless (ref($data) ne 'UICMS::DataTable') {
        my $index = 0;
        while ($data->getDataRow($index)) {
            my $row = $_;
            my %row_data;
            
            $row_data{row_num} = $index;
            $row_data{data_cells} = $row->toString;
            
            push @loop_data, \%row_data;
            $index++;
        }
        return @loop_data;
    }
    return \@loop_data;
}

1;
---


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to