Skip to content

Commit 73b58f6

Browse files
committed
perldelta entries for aslice/lslice scalar context
Notes that the `Useless use of %s in void context` warning will apply to some constructions of array/list slices when it did not previously. This is a result of specific OP handling cases being added into Perl_scalar, in order to reduce unnecessary execution of OPs at runtime.
1 parent 198c546 commit 73b58f6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

pod/perldelta.pod

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,21 @@ XXX Changes (i.e. rewording) of diagnostic messages go here
220220

221221
XXX Describe change here
222222

223+
=item *
224+
225+
L<Useless use of %s in void context|perldiag/"Useless use of %s in void context">
226+
227+
Scalar context was not always applied to arguments passed to list/array
228+
slices in the same way that is is applied elsewhere. This has been improved
229+
to reduce unnecessary OPs being executed at runtime. As a consequence, some
230+
statements may now trigger warnings when they previously did not.
231+
232+
For example, in C<my $x = (caller)[4,3,2];> or C<my $x = @y[4,3,2];>,
233+
warnings will now be emitted for the C<4> and C<3> arguments.
234+
235+
Note that the existing, documented behaviour of not warning for numerical
236+
constants equal to C<0> or C<1> still applies.
237+
223238
=back
224239

225240
=head1 Utility Changes

0 commit comments

Comments
 (0)