1. Precedence. The first is parsed as (($x = $i), next), the latter as (print("Next", next)). In the latter, next is evaluated before the print.
  2. Why? Do not assume Perl is made to be used by idiots, with warnings and flashing lights at any corner. Warning are more "uhm, hey, you know, this construct you are using, it may not do what you expect it to do". That's not the case in your second example. It can only mean one thing. But feel free to submit a patch that makes this warnable. (Remember: the golden rule of "why isn't X in Perl?" is "because you haven't written a patch to add it yet")
  3. Any two expressions can be separated by commas. See the perlop manual page.

In reply to Re: Multiple commands separated by commas by JavaFan
in thread Multiple commands separated by commas by tel2

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.