Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: How to iterate by fives?

by moof1138 (Curate)
on Feb 15, 2003 at 23:14 UTC ( #235623=note: print w/ replies, xml ) Need Help??


in reply to Re: How to iterate by fives?
in thread How to iterate by fives?

Thanks! I knew I was missing the obvious here. A modulus did the trick:

for my $i (1 .. $itemnum){ push (@tmp_row_items, $q->td($q->textfield( -name => "$champar +ray[$productcount][0]$i", -default => "$champarray[$productcount][$i] +", -size => 25))); if ($i % 5 == 0) { push (@rows, $q->td(@tmp_row_items)); @tmp_row_items = (); } }


Comment on Re: Re: How to iterate by fives?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (8)
As of 2014-12-20 23:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (99 votes), past polls