Do the parentheses around $x do anything?
It's one of the few cases where parenthesis actually create a list.
It seems to me that the rhs will always be a scalar,
Actually, in this case, it isn't. The context of the RHS of an assignment is determined by the LHS. In fact, assignment in list context is a different operator from assignment in scalar context - although both of them are represented by the same symbol. The important thing is context. The context of an expression is always determined by the context (duh!), and never by the expression itself. If the LHS of an assignment is a list, the RHS is in list context, regardless of how the RHS looks like.
and these are equivalent
They are equivalent in the sense they print the same thing. Do you consider:
my $x = 3 - 1; say $x;
and
my $y = length "ab"; say $y;
to be equivalent?

In your example, in the first case, $x gets the value of the scalar expression on the RHS of the assignment. In the second case, $y is assigned the value of the first element of the list on the RHS of the assignment. There's a difference. Whether you find the difference significant enough to call it not equivalent, or small enough to call it equivalent, I leave up to you. As long as you know what the difference is, it doesn't matter how you label it.


In reply to Re: list context by JavaFan
in thread list context by 7stud

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.