Any Perl-Tk program is an infinite loop, other here have mentioned other programs that have similar properties. But I draw a line between programs that are infinite on purpose and those that are simply broken.

Best way to tell the difference? If you need to hit Control-C or use kill, pskill Xkill or Task Manager, or a similar utility to stop your program, that may be a "bad" infinite loop. Take perl Tk for example, Your "infinite" loop is listening for events, and this allows you to code a proper exit or even a shutdown sequence. That way you can close your filehandles database handles etc. Your program could listen for events or other input to figure out when to exit.


In reply to Re: infinite loops == bad? by thunders
in thread infinite loops == bad? by BUU

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.