Skip to content

Commit dca6023

Browse files
SmylersFather Chrysostomos
authored andcommitted
Remove claim that state @A will be supported
perldiag doesn't seem to be the right place to announce future changes to Perl, especially since this claim was made 9 years ago, in 6dbe945, and doesn't show any sign of becoming true.
1 parent 7a6da5d commit dca6023

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pod/perldiag.pod

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2741,11 +2741,10 @@ either consume text or fail.
27412741

27422742
=item Initialization of state variables in list context currently forbidden
27432743

2744-
(F) Currently the implementation of "state" only permits the
2745-
initialization of scalar variables in scalar context. Re-write
2746-
C<state ($a) = 42> as C<state $a = 42> to change from list to scalar
2747-
context. Constructions such as C<state (@a) = foo()> will be
2748-
supported in a future perl release.
2744+
(F) C<state> only permits initializing a single scalar variable, in scalar
2745+
context. So C<state $a = 42> is allowed, but not C<state ($a) = 42>. To apply
2746+
state semantics to a hash or array, store a hash or array reference in a scalar
2747+
variable.
27492748

27502749
=item %%s[%s] in scalar context better written as $%s[%s]
27512750

0 commit comments

Comments
 (0)