Hi all, I'm completely new to Perl. What I'd like to do is have a loop (I'm assuming using a counter) That will print the first line below,"div class="row-fluid hideInIE8 data" only once per 6 times that the foreach goes through. this is a .cgi page printing html. Right now I realize the above line is outside of the print statement. Any help would be greatly appreciated! Thank you in advance.

<div class="row-fluid hideInIE8 data"> CTHULHU foreach (@fs_list) { my ($up) = $_->{usepercent} =~ m/(\d+)\%/; print qq(\t\t<div class="span2" onTablet="span4" onDesktop="sp +an2">\n); print qq(<div class="circleStatsItemBox NSBlue">); print qq(<div class="header">$_->{fsname}</div>); print qq(<span class="percent">percent</span>); print qq(<div class="circleStat">); print qq(<input type="text" value="$up" class="widget"/>); print qq(</div>); print qq(<div class="footer">); print qq(<span class="count">); print qq(<span class="number">$_->{availsize}</span>); #print qq(<span class="unit">) . $_->{avilsize} =~ m/\d+(\w+)/ + . qq(</span>); print qq(</span>); print qq(<span class="divide"> / </span>); print qq(<span class="value">); print qq(<span class="number">$_->{totalsize}</span>); #print qq(<span class="unit">) . ($_->{totalsize} =~ m/\d+(\w+ +)/) . qq(</span>); print qq(</span>); print qq(</div>); print qq(</div>); print qq(</div>); } print << "CTHULHU";

In reply to foreach loop by Anonymous Monk

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.