Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Thanks for your reply.

The test code is not broken though. The "recurse" function is really recursive, and goes down 2 levels deep. The "recurse1" actually calls "recurse2". This just a 2 level deep nested call. Which pretty much does the same thing as "recurse".

calling recurse, leaves blocks..
calling recurse1, leaves no blocks..

In both examples, they should be saving the same # of call stacks. They essentially do the same thing, they both do a 2 level deep nested call, except that "recurse" calls itself. That is basically the only difference between the two. rephrase what u said,
Everytime i make another function call (either to myself or another function), Perl has to save another stack frame. When you return (either from myself or another function), Perl pops that frame off the stack.

What im getting at, is that calling yourself or another function in a nested fashion _should_ do the same thing.

but doesnt appear so.

thanks for taking the time to read and answer.

In reply to Re: Re: Nested Calls, Recursion and MEMORY by robdog
in thread Nested Calls, Recursion and MEMORY by robdog

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (6)
    As of 2018-03-24 20:11 GMT
    Find Nodes?
      Voting Booth?
      When I think of a mole I think of:

      Results (299 votes). Check out past polls.