From: Vincent Pit <perl@profvince.com>
Date: Sat, 4 Nov 2017 15:13:47 +0000 (+0100)
Subject: Clarify how 'strict' and 'warn' currently work
X-Git-Tag: rt122956
X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=3b6049cb9391f87191afd4979c803495fa8f51d2;p=perl%2Fmodules%2Fautovivification.git

Clarify how 'strict' and 'warn' currently work

This fixes [RT #122956].
---

diff --git a/lib/autovivification.pm b/lib/autovivification.pm
index 8b70a75..1e4e06b 100644
--- a/lib/autovivification.pm
+++ b/lib/autovivification.pm
@@ -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