diff options
Diffstat (limited to 'pod/perldiag.pod')
-rw-r--r-- | pod/perldiag.pod | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/pod/perldiag.pod b/pod/perldiag.pod index bc0865216f..bd5039a81f 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -2741,11 +2741,10 @@ either consume text or fail. =item Initialization of state variables in list context currently forbidden -(F) Currently the implementation of "state" only permits the -initialization of scalar variables in scalar context. Re-write -C<state ($a) = 42> as C<state $a = 42> to change from list to scalar -context. Constructions such as C<state (@a) = foo()> will be -supported in a future perl release. +(F) C<state> only permits initializing a single scalar variable, in scalar +context. So C<state $a = 42> is allowed, but not C<state ($a) = 42>. To apply +state semantics to a hash or array, store a hash or array reference in a scalar +variable. =item %%s[%s] in scalar context better written as $%s[%s] |