Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 lurking in the Monastery: (7)
As of 2014-09-23 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (210 votes), past polls