[dup]
- @_=/./g;: The RHS of a list assignment operator is evaluated in list context.
- ()=/./g;: The RHS of a list assignment operator is evaluated in list context.
- /./g;: A expression statement followed by another is evaluated in void context[1].
- (/./g);: A expression statement followed by another is evaluated in void context[1].
- ()==/./g;: The RHS of a list assignment operator is evaluated in list context.
- $_[/./g];: The index expression of an array element is evaluated in scalar context.
- /./g;: The statement at the end of a while loop is evaluated in void context.
The behaviour of the match operator in void context doesn't appear to be documented, but is sensibly acts as if it was evaluated in scalar context.
$ perl -E'$_="abc"; /./g; /(.)/g; say $1'
b
- Not scalar context, as previously mentioned.