"Roderick A. Anderson" <[EMAIL PROTECTED]> writes:
> [...]
> When I use a simple
>
> $tt->('filename.tt', $MyVars);
>
> I get no output [...]
Most likely you want to replace this with
$tt->process('filename.tt', $MyVars);
--
HTH,
haj
__
Rather
than using print statements, copy all of your method's output into a variable
and return the content of that variable to template toolkit.
IE:
sub
generate_my_table() {
my $output =
'';
return $output
}
Note
that this is not ideal and you should let template toolkit
On Mon, 2004-04-12 at 18:24, Matthew Haines wrote:
> The &generate_my_table sub is full of print statements that print
> straight to STDOUT.
That is unfortunate. Not to worry though -- [% PERL %] blocks
automatically tie STDOUT and capture the output. Try this:
[% PERL %]
my $dbh = $stash->get(
I am trying to slowly migrate an application to TT
and have run into the following problem for which I hope there is an easy and
standard solution someone can point me to.
I have a large number of existing subroutines that
print out HTML. Usually these subroutines generate the HTML for a
On Mon, 12 Apr 2004, Aleksandr Guidrevitch wrote:
> Thanks Dave for a good try, but I have my
> own iterator (similar to Class::DBI::Iterator),
> which returns next value only by calling iterator.next,
> so it wouldn't work.
Well if it's your own iterator, why not add a C method so that you
can
Dave Cash wrote:
Well, the for me the problem is more complicated: I have iterator which
returns numbers:
[% WHILE (var = iterator.next) %] ... [% END %]
If iterator.next returns 0 the loop fails :(
If your iterator is a Template::Iterator, you can just do:
[% FOREACH var IN iterator %][% va
On Mon, 12 Apr 2004, Aleksandr Guidrevitch wrote:
> Dave Cash wrote:
>
> >
> >How about this?
> >
> > [% avar = [0,1,2] %][% WHILE avar.size %][% avar.shift %][% END %]
> >
> >
> Well, the for me the problem is more complicated: I have iterator which
> returns numbers:
> [% WHILE (var = iterator.n
Dave Cash wrote:
How about this?
[% avar = [0,1,2] %][% WHILE avar.size %][% avar.shift %][% END %]
Well, the for me the problem is more complicated: I have iterator which
returns numbers:
[% WHILE (var = iterator.next) %] ... [% END %]
If iterator.next returns 0 the loop fails :(