[ABE.pm] Text::Template Q

Faber J. Fedor faber at linuxnj.com
Mon Jul 31 11:24:41 PDT 2006


On 31/07/06 12:58 -0400, Ricardo SIGNES wrote:
> * "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!  

Which raises the question: how do you format variables for output
without using a printf()?  

Much of what I'm doing in my loops is stuff like this:

printf("   <td class=\"fundamentals data\"><a href a=\"self\">%5.2f<span>",
                $port->bucketsize($i) );
and

foreach my $company (@{$companyArray}){
    printf("            <tr><td>%10s</td><td>%5.2f</td></tr>\n",
                $company->[0], $company->[1]);
}

How do I get $port->bucketsize($i) to be a %5.2f (example 1) without
using printf?

-- 
 
Regards,
 
Faber Fedor
President
Linux New Jersey, Inc.
908-320-0357
800-706-0701

http://www.linuxnj.com





More information about the ABE-pm mailing list