All parens do is change precedence.[1]
is only written that way becausemy @a = ('a', 'b', 'c');
meansmy @a = 'a', 'b', 'c';
( my @a = 'a' ), 'b', 'c';
That's why
my @a = ( 1..4 );
is just a weird way of writing
my @a = 1..4;
That means that
use constant { zed => 0, one => 1, repos => (qw(oss non-oss debug)), two => 2, };
is a weird way of writing
use constant { zed => 0, one => 1, repos => 'oss', 'non-oss' => 'debug', two => 2, };
(Same goes when using repos => @{[qw(oss non-oss debug)]}.)
There's no way to support constants that represent more than one scalar (list use constant FOO => "a", "b";) when passing hash reference because adding support for that would have made the syntax insanely complicated.
Two exceptions:
They can affect whether an assignment is a scalar assignment operator or a list assignment operator as described here.
() is the stub operator, an expression that evaluates to 0 scalars in list context and undef in scalar context.
In reply to Re: use constant; RHE of solo confusing in list
by ikegami
in thread use constant; RHE of solo confusing in list
by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |