Only if you define "a list" as being something rather specific that doesn't match many, many uses of the term "list" in even just the standard *.pod documentation.

Some argue that you can't "evaluate a list in a scalar context" because the scalar context prevents the creation of the list in the first place (clearly they have a different, specific definition of the term "list" in mind when they say this). Some argue that there is no general rule about what you get when you evaluate a list in a scalar context: you could get the last element, a count of elements, the first element, or something else entirely. This fits a bit closer to my thinking on the matter.

I prefer to be very careful and say that evaluting "something that would return a list if used in a list context" in a scalar context may get you any number of things. One of the most common is the last element of the list.

I also feel that the term "list" is used to mean so many different things in so many different standard texts on Perl that saying anything definitive about "a list" without first carefully defining what "a list" means to you (at that moment) is likely to be an incorrect or at least overbroad statement.

        - tye (but my friends call me "Tye")

In reply to (tye)Re: storing all type of vars by tye
in thread storing all type of vars by Anonymous Monk

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.