|To:||perlbug [...] perl.org|
|Subject:||Documentation of backslash operator inducing list context for its operand is missing|
|From:||Håkon Hægland <hakon.hagland [...] gmail.com>|
|Date:||Sat, 25 Mar 2017 23:24:49 +0100|
I could not find any documentation for the following behavior:
$ perl -E '$s =\sort qw(a b c); say $$s'
According to the documentation for sort, the behavior of sort in scalar context is undefined
$ perl -E '$s = sort qw(a b c); say "undef" if !defined $s'
Apparently when using the backslash operator, sort does not consider
itself to be in scalar context any more, or else the first example should give an undefined $$s.
I checked the following documentation: