Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: foreach loop
by InfiniteSilence (Curate) on May 14, 2014 at 13:49 UTC | |
|
Re: foreach loop
by davido (Cardinal) on May 14, 2014 at 15:09 UTC | |
|
Re: foreach loop
by vinoth.ree (Monsignor) on May 14, 2014 at 13:44 UTC | |
|
Re: foreach loop
by Anonymous Monk on May 14, 2014 at 14:03 UTC | |
|
Re: foreach loop
by Anonymous Monk on May 14, 2014 at 15:31 UTC | |
|
Re: foreach loop
by Anonymous Monk on May 14, 2014 at 14:27 UTC | |
by ikegami (Patriarch) on May 14, 2014 at 15:03 UTC | |
by vinoth.ree (Monsignor) on May 14, 2014 at 15:09 UTC |