From: Vincent Pit Date: Sun, 10 Jan 2010 00:25:58 +0000 (+0100) Subject: This is 0.04 X-Git-Tag: v0.04^0 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=c3fc4d9635093e7de8f4d59aacfee773c7100e24;p=perl%2Fmodules%2Fautovivification.git This is 0.04 --- diff --git a/Changes b/Changes index dd93f87..6427320 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ Revision history for autovivification +0.04 2010-01-10 00:30 UTC + + Add : Array and hash slices are now handled by the pragma. + + Fix : Work around Kwalitee test misfailures. + 0.03 2009-06-23 22:20 UTC + Add : Handle old-fashion dereferencing (like $$hashref{key}). + Chg : Aliasing constructs (for ($x{foo}) { ... }) are now covered by diff --git a/META.yml b/META.yml index 5edfebb..e1d00d5 100644 --- a/META.yml +++ b/META.yml @@ -1,6 +1,6 @@ --- #YAML:1.0 name: autovivification -version: 0.03 +version: 0.04 abstract: Lexically disable autovivification. author: - Vincent Pit @@ -11,6 +11,7 @@ configure_requires: build_requires: ExtUtils::MakeMaker: 0 Test::More: 0 + XSLoader: 0 requires: perl: 5.008 XSLoader: 0 @@ -23,7 +24,8 @@ no_index: directory: - t - inc -generated_by: ExtUtils::MakeMaker version 6.52 +generated_by: ExtUtils::MakeMaker version 6.56 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 +dynamic_config: 1 diff --git a/README b/README index 2163a42..4f119c5 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME autovivification - Lexically disable autovivification. VERSION - Version 0.03 + Version 0.04 SYNOPSIS no autovivification; @@ -41,10 +41,11 @@ METHODS Turn off autovivification for rvalue dereferencing expressions, such as "$value = $hashref->{key}[$idx]{$field}", "keys - %{$hashref->{key}}" or "values %{$hashref->{key}}". When the - expression would have autovivified, "undef" is returned for a plain - fetch, while "keys" and "values" return 0 in scalar context and the - empty list in list context. + %{$hashref->{key}}" or "values %{$hashref->{key}}". Starting from + perl 5.11, it also covers "leys" and "values" on array references. + When the expression would have autovivified, "undef" is returned for + a plain fetch, while "keys" and "values" return 0 in scalar context + and the empty list in list context. * 'exists' @@ -92,6 +93,14 @@ METHODS When @opts is empty, it defaults to restoring the original Perl autovivification behaviour. +CAVEATS + The pragma doesn't apply when one dereferences the returned value of an + array or hash slice, as in "@array[$id]->{member}" or + @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. + DEPENDENCIES perl 5.8. @@ -124,7 +133,7 @@ ACKNOWLEDGEMENTS Matt S. Trout asked for it. 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. diff --git a/lib/autovivification.pm b/lib/autovivification.pm index 34bc74a..9d009a8 100644 --- a/lib/autovivification.pm +++ b/lib/autovivification.pm @@ -11,13 +11,13 @@ autovivification - Lexically disable autovivification. =head1 VERSION -Version 0.03 +Version 0.04 =cut our $VERSION; BEGIN { - $VERSION = '0.03'; + $VERSION = '0.04'; } =head1 SYNOPSIS