[ABE.pm] Text::Template Q

Ricardo SIGNES rjbs-perl-abe at lists.manxome.org
Mon Jul 31 09:58:39 PDT 2006


* "Faber J. Fedor" <faber at linuxnj.com> [2006-07-31T12:37:47]
> What I'm seeing is all of the above on STDOUT and two blanks lines in
> test.out.

That's because...

> {
>   print "Date is $date\n"  ; 
>   my $i;
>   for ($i = 0; $i<= 10; $i++) {print "$i\n"};
> } 

You do not print in a Text::Template!  In the documentation, you will find
this:

  http://search.cpan.org/~mjd/Text-Template/lib/Text/Template.pm#The_%24OUT_variable

If you want to build up output, you use $OUT and append to it.

Alternately, you just have blocks that return something.  You almost certainly
want to use $OUT, though, in this case.

I wonder how you ever had it working, using print...

-- 
rjbs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.pm.org/pipermail/abe-pm/attachments/20060731/be34b4bf/attachment.bin 


More information about the ABE-pm mailing list