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.
In reply to Re: perl statements
by ack
in thread perl statements
by neptuneray
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |