Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Separating by threes

by tachyon (Chancellor)
on Nov 23, 2004 at 04:11 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://409801]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-03-28 23:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found