http://www.perlmonks.org?node_id=594517


in reply to Re: (RFC) Arrays: A Tutorial/Reference
in thread (RFC) Arrays: A Tutorial/Reference

Parentheses don't create lists

I guess they do. At least they force list context:

qwurx [shmem] ~ > perl -le '$_ = "foo bar baz"; $c = /\w+/g; print $c' 1 qwurx [shmem] ~ > perl -le '$_ = "foo bar baz"; $c = () = /\w+/g; prin +t $c' 3

<update>

The first line only prints out wether the match succeeded. The second form forces the match to be done in list context. The resulting list is then evaluated in scalar context. Or is that also a kind of disambiguation (of the match operator)?

qwurx [shmem] ~ > perl -le '$_ = "foo bar baz"; $c = (/\w+/g); print $ +c' 1

Hmm.. here they obviously don't force list context?

</update>

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}