Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I was perusing perlfaq4 during my lunch break today and came across the topic "How do I handle linked lists?" The first sentence of the answer reads in part as follows: "In general, you usually don't need a linked list in Perl..." I did a double take and a silent "Hoo-aahh!"

I have rather nasty memories of trying to follow material on linked lists in certain algorithm texts years ago, so realizing that a programming language (i.e. Perl) can be widely accepted without linked lists as a feature was gratifying and enlightening.

Another quote from the faq: "If you really, really wanted, you could use structures as described in perldsc or perltoot and do just what the algorithm book tells you to do...but again, Perl's built-in are virtually always good enough." To me, this is another feature that pushes Perl to the top of my list when considering languages to use for coding projects.

Have any monks implemented linked-list structures in their Perl code, and if so did your performance improvements outweigh the additional complexity of the code?

Update: The node Shift, Pop, Unshift and Push with Impunity! showed up in the Selected Best Nodes and based on my reading of it makes me comfortable that Perl is very efficient at taking care of the kind of work that linked-list code might otherwise be needed to do such as demerphq describes in his reply in this thread.

In reply to Linked Lists and Perl by Scott7477

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (8)
    As of 2014-08-01 05:20 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (256 votes), past polls