Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Separating by threes

by tachyon (Chancellor)
on Nov 23, 2004 at 04:11 UTC ( #409801=note: print w/replies, xml ) Need Help??


in reply to Separating by threes

Your guess about a table is spot on.....

my $err = join "\n", map { "Error $_<br>" } 0..100; my @errs = split /<br>\s*/, $err; $err = qq!<table width="100%">\n!; for ( my $i=0; $i<@errs; $i+=3 ) { $err .= sprintf "<tr><td>%s</td><td>%s</td><td>%s</td></tr>\n", map { defined $_ ? $_ : '' } @errs[$i..$i+2]; } $err .= "</table>\n"; print $err;

You could save yourself the split by simply pushing the errors into the @errs array in the first place.

cheers

tachyon

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2018-08-20 20:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:









    Results (196 votes). Check out past polls.

    Notices?