On Fri, Apr 29, 2011 at 16:37, Michael Peters <mpet...@plusthree.com> wrote:
> On 04/29/2011 05:28 PM, David A. Bandel wrote:
>
>> my @calloutdata;
>> foreach $callskey ( sort {$callnum{$b}<=>  $callnum{$a}} keys %callnum){
>>     my %outbound;
>>     $outbound{EXTENNUMCALLED}  = $callskey;
>>     $outbound{TIMESCALLED}      = $callnum{$callskey};
>>     push( @calloutdata, \%outbound );
>> }
>>
>>         $template->param( OUTBOUNDS =>  \@calloutdata );
>>
>> The calloutdata array winds up to be about 200 lines long.  Any way to
>> have the TMPL_LOOP stop output after 15 or so table lines?
>
> Well, the first thing I'd do is suggest that if possible you just don't put
> all 200 things into the loop. That would save on your processing if you
> didn't have to create the big loop to begin with.

Unfortunately, in order to do what I'm doing (you haven't seen the
code that comes before), I need all the values all at once or the sort
on the value of the key/value pair doesn't work.


>
> But if you needed them in the loop in some places but didn't want to display
> them in others, you can use the __counter__ loop context var combined with
> HTML::Template::Expr.

It's an idea.  But hoping to keep it simple.

>
> <tmpl_loop outbounds>
>  <tmpl_if expr="__counter__ <= 15">
>    ...
>  </tmpl_if>
> </tmpl_loop>
>
>> Nothing in the docs suggests a way to do this (or am I missing
>> something?).
>
> It's not possible with just HTML::Template, but HTML::Template::Expr should
> help you get there.
>
> --
> Michael Peters
> Plus Three, LP
>

Will keep this in mind.

Thanx,

David A. Bandel
-- 
Focus on the dream, not the competition.
            - Nemesis Air Racing Team motto
Visit my web page at: http://david.bandel.us/

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Html-template-users mailing list
Html-template-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to