Oh fellow seekers of wisdom..We shape clay into a pot, but it is the emptiness inside that holds whatever we want.....
The code below breaks up the @stat_array into fours and then prints out fields in to an HTML table wih the OCOMsg2 cell in red - again - just one cell of the emailed table. print Dumper @stat_array_rows; sleep 1; exit; The boss told me that he wants the WHOLE LINE with the OCOMsg2 in red - so the array below, all the elements - "ibfarm102 - localtick", 'New York", "hibmis100 - procHKHD2 - Hongkong", "OCOMsg2" need to be red. print Dumper @stat_array_rows; sleep 1; exit; Is there a way to do this with out rewriting the whole block - I really like this block..

@stat_array = ("ibfarm102 - localtick", "Boston" , "hibmis100 - proc +HKHD2 - Hongkong", "PidMonRsp", "eufarm102 - localtick", "London", "hibmis100 - procHKHD2 - Hongkong +" , "PidMonReq" , "ibfarm102 - localtick", "New York" , "hibmis100 - procHKHD2 - Hongk +ong", "PidMonRsp", "ibfarm102 - localtick", 'New York", "hibmis100 - procHKHD2 - Hongko +ng", "OCOMsg2"); my @stat_array_rows = @stat_array; while (my @stat_array_rows = splice(@stat_array_rows, 0 , 4)) { print MAIL "<tr>\n"; for my $stat_row(@stat_array_rows) { #if ($stat_row eq $config_msgtype){ if ($stat_row =~/OCAlive2/){ print MAIL "<td><font color=red>$stat_row[0]</font></td>\n"; } else { print MAIL "<td>$stat_row</td>\n"; } } print MAIL "</tr>\n"; }

this are the results of the block:

<tr> <td>ibfarm102 - localtick </td> <td> Boston</td> <td> hibmis100 - procHKHD2 - Hongkong </td> <td>PidMonRsp</td> </tr> <tr> <td>eufarm102 - localtick </td> <td>London</td> <td> hibmis100 - procHKHD2 - Hongkong </td> <td>PidMonReq</td> </tr> <tr> <td>ibfarm102 - localtick </td> <td>New York</td> <td> hibmis100 - procHKHD2 - Hongkong </td> <td>PidMonRsp</td> </tr> <tr> <td>ibfarm102 - localtick </td> <td>New York</td> <td> hibmis100 - procHKHD2 - Hongkong </td> <td>OCOMsg2</td> </tr>

this is the data Dumper

print Dumper @stat_array $VAR1 = [ 'ibfarm102 localtick', ' Greenwich', ' hibmis100 procHKHD2 Hongkong ', 'PidMonRsp' ]; print Dumper @stat_array_rows. $VAR1 = 'ibfarm102 localtick'; $VAR2 = ' Greenwich'; $VAR3 = ' hibmis100 procHKHD2 Hongkong '; $VAR4 = 'PidMonRsp';

In reply to perl generated table - format color by casperdaghost

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.