What seems to be the trouble?

Your code seems to be generating a complete HTML document which I guess you are sending to a browser. The second iteration of the loop will send the same complete HTML document as will subsequent iterations.

When the browser receives the HTML document it will process it. From memory, the HTML spec is that everything after the closing </html> should be ignored. This means all of your code's output after the first iteration of your loop. So this could be one reason why your code appears not to get past the first time around the loop.

Also, bear in mind that one of the first things you are telling the browser to do is go off somewhere else! It will obey this instruction pretty quickly after it gets the <meta http-equiv="refresh"> command. Once it goes off somewhere else, it won't be loading in anything else you send to it.

It strikes me that you want to approach this problem in a different manner...


In reply to Re: Doubt about Template Toolkit by Bod
in thread Doubt about Template Toolkit by logangha

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.