X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Fautovivification.git;a=blobdiff_plain;f=lib%2Fautovivification.pm;h=dfb7d04accfaa9ea59fcf924db69f03033bf61ea;hp=4c32719d741a8bf15bfd35c402a6f65fa6b9a2fc;hb=HEAD;hpb=0815af96defabe600917fb0ba73a676235884a36 diff --git a/lib/autovivification.pm b/lib/autovivification.pm index 4c32719..dfb7d04 100644 --- a/lib/autovivification.pm +++ b/lib/autovivification.pm @@ -11,13 +11,13 @@ autovivification - Lexically disable autovivification. =head1 VERSION -Version 0.13 +Version 0.18 =cut our $VERSION; BEGIN { - $VERSION = '0.13'; + $VERSION = '0.18'; } =head1 SYNOPSIS @@ -57,8 +57,8 @@ BEGIN { no autovivification; # defaults to qw no autovivification qw; - no autovivification 'warn'; - no autovivification 'strict'; + no autovivification warn => @categories; + no autovivification strict => @categories; Magically called when C 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 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 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 >>. 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, @@ -238,15 +244,13 @@ You can find documentation for this module with the perldoc command. perldoc autovivification -Tests code coverage report is available at L. - =head1 ACKNOWLEDGEMENTS Matt S. Trout asked for it. =head1 COPYRIGHT & LICENSE -Copyright 2009,2010,2011,2012,2013,2014 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.