the list is never assigned to a variable

This is why it cannot "stick around." There is no place for this list to live. Lists are, by definition, temporary things. Unless you put the list into an array, and absent some under-hood optimization I am not aware of, it will disappear as soon as it is done with.

On a side note, I think you might be engaging in what is commonly known as premature optimization, or even nano-optimization. I have not run the benchmarks, but I would be shocked to find the creation of the list has any impact on the actual performance of an application. I can understand the desire to know how perl works a bit better, but trying to use this type of thing as a real optimization would almost surely be fruitless.


In reply to Re: Resource allocation question by revdiablo
in thread Resource allocation question by shemp

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.