]> git.vpit.fr Git - perl/modules/autovivification.git/blobdiff - lib/autovivification.pm
Note that A_THREADSAFE only has a meaning with a threaded perl
[perl/modules/autovivification.git] / lib / autovivification.pm
index 1bab02f6466839d44978531853d89c1c348125e6..9ef999448b07a5fb61cac7a3c77879c7db65f6ef 100644 (file)
@@ -11,13 +11,13 @@ autovivification - Lexically disable autovivification.
 
 =head1 VERSION
 
-Version 0.03
+Version 0.05
 
 =cut
 
 our $VERSION;
 BEGIN {
- $VERSION = '0.03';
+ $VERSION = '0.05';
 }
 
 =head1 SYNOPSIS
@@ -65,7 +65,7 @@ Enables the features given in C<@opts>, which can be :
 C<'fetch'>
 
 Turn off autovivification for rvalue dereferencing expressions, such as C<< $value = $hashref->{key}[$idx]{$field} >>, C<< keys %{$hashref->{key}} >> or C<< values %{$hashref->{key}} >>.
-Starting from perl C<5.11>, it also covers C<leys> and C<values> on array references.
+Starting from perl C<5.11>, it also covers C<keys> and C<values> on array references.
 When the expression would have autovivified, C<undef> is returned for a plain fetch, while C<keys> and C<values> return C<0> in scalar context and the empty list in list context.
 
 =item *
@@ -151,6 +151,24 @@ sub import {
  ();
 }
 
+=head1 CONSTANTS
+
+=head2 C<A_THREADSAFE>
+
+True iff the module could have been built with thread-safety features enabled.
+This constant only has a meaning with your perl is threaded ; otherwise, it'll always be false.
+
+=head2 C<A_FORKSAFE>
+
+True iff this module could have been built with fork-safety features enabled.
+This will always be true except on Windows where it's false for perl 5.10.0 and below .
+
+=head1 CAVEATS
+
+The pragma doesn't apply when one dereferences the returned value of an array or hash slice, as in C<< @array[$id]->{member} >> or C<< @hash{$key}->{member} >>.
+This syntax is valid Perl, yet it's discouraged as the slice is here useless since the dereferencing enforces scalar context.
+If warnings are turned on, Perl will complain about one-element slices.
+
 =head1 DEPENDENCIES
 
 L<perl> 5.8.
@@ -186,7 +204,7 @@ Matt S. Trout asked for it.
 
 =head1 COPYRIGHT & LICENSE
 
-Copyright 2009 Vincent Pit, all rights reserved.
+Copyright 2009,2010 Vincent Pit, all rights reserved.
 
 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.