in reply to foreach problem
That builds up a row, and prints it when it's finished. For the last row, it creates cells with a single non-breaking space in them, which avoids formatting annoyances in some browsers.my @cols = (); foreach (@files) { $_ =~ s/.*[\/\\](.*)/$1/; push(@cols,td(submit(-name => 'file', -value => $_)); if (@cols == 4) { print Tr({-alien => 'center'}, @cols); @cols=(); } } if (@cols) { while (@cols < 4) { push(@cols,td(' ')); } print Tr({-alien => 'center'}, @cols); }
|
|---|