in reply to perl statements

Many Perlers will censure the use of the comma as given. I'd usually avoid the construct, but if the context is simple and the core statement, the part up to if, is just a couple of "words", I'll write such.
$names++, shift if ARGV[0] eq "-l";
In scalar context, the comma operator separates expressions and returns the evaluation of the rightmost expression. Here, the first expression is evaluated and the result discarded; the side-effect of incrementing $names remains.

Update: It should be noted that no list is created by a series of comma operators in scalar context. The expressions operated on by the commas become subexpressions.

The second construct is similar but I find it odder.

$c = do { $a = 3, $b = 6 };
The same thing is happening; the assignments are in scalar context. I'd write this with a semi-colon in the middle of the do's block; one standard use of the do BLOCK is to wedge a statement or statements into a place that needs an expression. If $c were @c, my semi-colon would change the meaning.

Be well,
rir