Hey folks. After reading previous posts on the topic of using linked lists in Perl, Ive come to the conclusion that the general concensus is that in Perl you will almost never need to use a linked list as push,pop,splice,etc on arrays provides the same functionality.

In my scenario Im putting together a non-blocking shell on Win32 and I want the lowest possible CPU usage I can get. I have the shell functional using an Array as the input storage mechanism, yet I'm questioning the potential resource savings I would get (in Perl) by using a linked list instead. The main reason Im questioning this is that the same code to handle the input string will also be used to perform simple editing of text documents within the same program.

So lets say I need to use as little CPU as possible, and I need to manipulate a block of text from anywhere within that block of text.

Now for my question.

Would you use a linked list instead, and would there be any modules out there that you would use instead of brewing it up from scratch?

In reply to Array VS Linked List by asset

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.