File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,34 @@ here, but most should go in the L</Performance Enhancements> section.
27
27
28
28
[ List each enhancement as a =head2 entry ]
29
29
30
+ =head2 @_ is now experimental within signatured subs
31
+
32
+ Even though subroutine signatures currently remain experimental, use of the
33
+ default arguments array (C<@_>) with a subroutine that has a signature is
34
+ specifically also experimental, with its own warning category. Silencing the
35
+ C<experimental::signatures> warning category is not sufficient to dismiss
36
+ this. The new warning is emitted with the category name
37
+ C<experimental::args_array_with_signatures>.
38
+
39
+ Any subroutine that has a signature and tries to make use of the defaults
40
+ argument array or an element thereof (C<@_> or C<$_[INDEX]>), either
41
+ explicitly or implicitly (such as C<shift> or C<pop> with no argument) will
42
+ provoke a warning at compile-time:
43
+
44
+ use experimental 'signatures';
45
+
46
+ sub f ($x, $y = 123) {
47
+ say "The first argument is $_[0]";
48
+ }
49
+
50
+ Z<>
51
+
52
+ Use of @_ in array element with signatured subroutine is experimental
53
+ at file.pl line 4.
54
+
55
+ The behaviour of code which attempts to do this is no longer specified, and
56
+ may be subject to change in a future version.
57
+
30
58
=head1 Security
31
59
32
60
XXX Any security-related notices go here. In particular, any security
You can’t perform that action at this time.
0 commit comments