]> git.vpit.fr Git - perl/modules/autovivification.git/blobdiff - lib/autovivification.pm
This is 0.18
[perl/modules/autovivification.git] / lib / autovivification.pm
index 3761b82f6b1b0dcb53a0f1dbaba12de833fc5be1..dfb7d04accfaa9ea59fcf924db69f03033bf61ea 100644 (file)
@@ -1,6 +1,6 @@
 package autovivification;
 
-use 5.008003;
+use 5.008_003;
 
 use strict;
 use warnings;
@@ -11,13 +11,13 @@ autovivification - Lexically disable autovivification.
 
 =head1 VERSION
 
-Version 0.10
+Version 0.18
 
 =cut
 
 our $VERSION;
 BEGIN {
- $VERSION = '0.10';
+ $VERSION = '0.18';
 }
 
 =head1 SYNOPSIS
@@ -57,8 +57,8 @@ BEGIN {
 
     no autovivification; # defaults to qw<fetch exists delete>
     no autovivification qw<fetch store exists delete>;
-    no autovivification 'warn';
-    no autovivification 'strict';
+    no autovivification warn   => @categories;
+    no autovivification strict => @categories;
 
 Magically called when C<no autovivification @opts> is encountered.
 Enables the features given in C<@opts>, which can be :
@@ -125,13 +125,19 @@ In the example, this would require C<$arrayref> (resp. C<$hashref>) to already b
 
 C<'warn'>
 
-Emits a warning when an autovivification is avoided.
+Emits a warning when an autovivification is avoided for the categories specified in C<@opts>.
+
+Note that C<no autovivification 'warn'> currently does nothing by itself, in particular it does not make the default categories warn.
+This behaviour may change in a future version of this pragma.
 
 =item *
 
 C<'strict'>
 
-Throws an exception when an autovivification is avoided.
+Throws an exception when an autovivification is avoided for the categories specified in C<@opts>.
+
+Note that C<no autovivification 'strict'> currently does nothing by itself, in particular it does not make the default categories die.
+This behaviour may change in a future version of this pragma.
 
 =back
 
@@ -144,7 +150,7 @@ When C<@opts> is empty, it defaults to C<< qw<fetch exists delete> >>.
 my %bits = (
  strict => A_HINT_STRICT,
  warn   => A_HINT_WARN,
- fetch  => A_HINT_FETCH,
+ fetch  => A_HINT_FETCH|A_HINT_KEYS|A_HINT_VALUES,
  store  => A_HINT_STORE,
  exists => A_HINT_EXISTS,
  delete => A_HINT_DELETE,
@@ -200,10 +206,14 @@ This constant will always be true, except on Windows where it is false for perl
 
 =head1 CAVEATS
 
+Using this pragma will cause a slight global slowdown of any subsequent compilation phase that happens anywere in your code - even outside of the scope of use of C<no autovivification> - which may become noticeable if you rely heavily on numerous calls to C<eval STRING>.
+
 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 is 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.
 
+Autovivifications that happen in code C<eval>'d during the global destruction phase of a spawned thread or pseudo-fork (the processes used internally for the C<fork> emulation on Windows) are not reported.
+
 =head1 DEPENDENCIES
 
 L<perl> 5.8.3.
@@ -211,7 +221,7 @@ L<perl> 5.8.3.
 A C compiler.
 This module may happen to build with a C++ compiler as well, but don't rely on it, as no guarantee is made in this regard.
 
-L<XSLoader> (standard since perl 5.006).
+L<XSLoader> (standard since perl 5.6.0).
 
 =head1 SEE ALSO
 
@@ -234,15 +244,13 @@ You can find documentation for this module with the perldoc command.
 
     perldoc autovivification
 
-Tests code coverage report is available at L<http://www.profvince.com/perl/cover/autovivification>.
-
 =head1 ACKNOWLEDGEMENTS
 
 Matt S. Trout asked for it.
 
 =head1 COPYRIGHT & LICENSE
 
-Copyright 2009,2010,2011,2012 Vincent Pit, all rights reserved.
+Copyright 2009,2010,2011,2012,2013,2014,2015,2017 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.