Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: A question regarding HTML::Template, tables, and loops

by LTjake (Prior)
on Aug 31, 2002 at 22:08 UTC ( #194392=note: print w/ replies, xml ) Need Help??


in reply to A question regarding HTML::Template, tables, and loops

Hi. You'll want to check out jeffa's reply to one of my own questions.

This little snippet is the key:

use strict; use Data::Dumper; my ($i,$j) = (0,0); my $tab; for (0..10) { push @{$tab->[$j]},$_; $j++ unless ++$i % 4; } print Dumper $tab;
which returns this:
$VAR1 = [ [ 0, 1, 2, 3 ], [ 4, 5, 6, 7 ], [ 8, 9, 10 ] ];
You could then just nest a loop within a loop.

HTH.


Comment on Re: A question regarding HTML::Template, tables, and loops
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://194392]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2014-09-02 18:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (29 votes), past polls