Greetings ,
I have run into a problem while writing @arrays to a subroutine. I am concantenating the result from the subroutine words() to four different tables.
The first 2 lines return the correct results without any problem the second 2 lines produce an endless loop.
$table_one .= words(\@data_one);
$table_two .= words(\@data_two);
$table_three .= words(\@data_three);
$table_four .= words(\@data_four);
The loop that is getting stuck is where the HTML for the tables is concantenated and later returned. I had added 3 print statements in the loop and the print statement that keeps looping is "we are in MAIN loop".
Thanks You for any help
Cal
while ($count < $elements) {
print ("we are in MAIN loop\n");
while ($tr++ < $cols) {
$test .= "<tr>";print ("we are in TR loop\n");
my $tc=0;
while ($tc++ < $rows) {
$test .="<td width='25%'align='left'>".(@{$ref}[$count]).'</td>'."\n";
print ("we are in tc loop\n");$count++
} # MAIN loop
} $test .= "</tr>"; # tr loop
} # td loop
$test .= "</tr>";
} else {#do something else}
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.