Both kyle and rir have provided the definitive responses. I am far too junior a monk to enhance either response. For what it is worth, I can, however, provide what the Camel book has to say. According to the Camel (Programming Perl,3rd ed., Wall, Christiansen & Orwant, O'Riley: 2000, pp. 108-109) with respect to the COMMA OPERATORS:

In scalar context it [the comma operator] evaluates its left argument in void context, throws the value away, then evaluates its right argument in scalar context and returns that value.

It goes on to say that:

Do not confuse the scalar context with the list context use. In list context, the comma is just the list argument separator, and inserts both its arguments into the LIST. It does not throw any values away.

In that same reference on pg. 131, the authors go on to say:

Modifiers bind more tightly (with higer precedence) than the comma does. The following example erroneously declares one variable, not two, because the list following the modifier is not enclosed in parentheses.
my $foo, $bar = 1; # wrong # The above has the same effect # as: my $foo; $bar = 1;

Hope that helps a little.

ack Albuquerque, NM

In reply to Re: perl statements by ack
in thread perl statements by neptuneray

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.