Some of those data structures that you never notice, the reason that you never notice them being coded up in Perl is because they don't have to be coded up by hand; Perl has stuff that accomplishes the same thing without a lot of extra work. Linked lists are a perfect example. Nobody _needs_ to code up linked lists in Perl, because Perl isn't so primitive as C. Perl isn't Lisp, but it has more builtin list-processing stuff than C. C programmers find them using linked lists sometimes when they don't know the length of an array at compile time; we don't need that sort of kludge in Perl because arrays are dynamic in length. We also don't need them for most of the other things they're used for in C (e.g., inserting items in the middle), because again Perl already has enough power to do stuff like that without the extra help. Linked lists are also used to implement stacks sometimes, but Perl just uses arrays for that. That's what we have push and pop for, after all. Trees you will occasionally see in Perl, though; I think there are a CPAN module or two for working with them. But there is one major use of trees that you won't see much in Perl: they're often used for sorting and searching, and Perl programmers are more likely to use hashes for that, or the builtin sort primitive, or both together, or throw it all in a database and use DBI. But trees are generally useful, so you will see them used sometimes for other things, as well as directed and undirected graphs occasionally

In reply to Re: Re: Recursion, tree parsing. by jonadab
in thread Recursion, tree parsing. 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.