My recurse_tree function is creating "phantom nodes" (i.e. Tree:Nary nodes with an empty {data} field ) both when I take in the subtree node by reference, and when I take it in by value, i.e.:

# By reference my $root_address = shift; my $root = $$root_address;

AND
# By value my $root = shift;

both lead to creating of phantom nodes in my N-ary tree. These tend to be close to the top of the tree, but print-traversal of my Tree::Nary tree shows they are not the immediate children of my Tree's root. Also debug statements that use the Tree::Nary->n_nodes function show these phantom nodes are being made in my recurse_tree() function and nowhere else. Neither recurse_tree nor its helper, find_subtree(), use the Tree::Nary append or prepend functions.

I am on vacation but as soon as I can I will post a copy of my recurse_tree() function here.

Thank You,
Amphiaraus

In reply to Re^2: Tree::Nary -- my program is creating phantom nodes by Amphiaraus
in thread Tree::Nary -- my program is creating phantom nodes by Amphiaraus

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.