If it's a recursion, it needs to be written as a for loop or some kind of loop. If you see that your sub-routine calls itself, double check that. That's often a program design error.

If you're doing an assembly language routine, which dumps things on the stack and then calls itself and does that in a big loop many-many times like millions of times, that's a bug. Should be resolved. The only place where I can think that is used is where someone wants to read the contents of a directory, so upon finding a subdir, the ReadDIR function calls itself.. But even in Linux ext4 file system, there is a thing called max path depth, which is like 2048. So, that limits how many times your ReadDIR will call itself. And we never see that kind of depth anywhere, but you could achieve that if you created a directory called "A" and then within that directory, you created another one called "A" and so on until you go down to 2048 deep /A/A/A/A/A/A/A/A/..... but that's not the end of the world. A program should be able to handle that. But generally speaking, when you call yourself from a sub-routine, that's a design flaw.


In reply to Re^3: How am i doing? by harangzsolt33
in thread How am i doing? 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.