--- trunk/lib/WebPAC/Output/TT.pm 2005/11/19 23:48:19 69 +++ trunk/lib/WebPAC/Output/TT.pm 2005/11/19 23:48:24 70 @@ -70,7 +70,7 @@ my $text = $tt->apply( template => 'text.tt', - data => \@ds + data => $ds ); It also has follwing template toolikit filter routies defined: @@ -90,7 +90,7 @@ =head3 tt_filter_type -filter to return values of specified from @ds +filter to return values of specified from $ds =cut @@ -109,13 +109,11 @@ my ($name,$join) = @_; - die "no data array" unless ($data->{'data'} && ref($data->{'data'}) eq 'ARRAY'); + die "no data hash" unless ($data->{'data'} && ref($data->{'data'}) eq 'HASH'); # Hm? Should we die here? return unless ($name); - my $item = first { $_->{'name'} eq $name } @{ $data->{'data'} }; - - return unless($item); + my $item = $data->{'data'}->{$name} || return; my $v = $item->{$type} || return; @@ -153,7 +151,7 @@ $tt->to_file( file => 'out.txt', template => 'text.tt', - data => \@ds + data => $ds ); =cut