From: Vincent Pit Date: Mon, 5 Nov 2012 02:30:14 +0000 (-0200) Subject: This is 0.52 X-Git-Tag: v0.52^0 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=fceb925d08fa5e96cf477963195c3c4f6dbede65;p=perl%2Fmodules%2FVariable-Magic.git This is 0.52 --- diff --git a/Changes b/Changes index 2c1ca8d..748a344 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,13 @@ Revision history for Variable-Magic +0.52 2012-11-05 02:30 UTC + + Add : The new constant VMG_COMPAT_SCALAR_NOLEN evaluates to true + when your perl does not call 'len' magic for scalars, which + is the case for perl 5.17.4 and above. + This fixes RT #80388. + + Tst : t/35-stash.t has been taught about perl 5.17.4. + + Tst : Author tests overhaul. + 0.51 2012-08-18 15:00 UTC + Fix : It is now safe to call dispell() from inside 'free', 'copy' and 'uvar' callbacks to dispell the magic currently in use. diff --git a/META.json b/META.json index a1c163b..2127368 100644 --- a/META.json +++ b/META.json @@ -60,5 +60,5 @@ "url" : "http://git.profvince.com/?p=perl%2Fmodules%2FVariable-Magic.git" } }, - "version" : "0.51" + "version" : "0.52" } diff --git a/META.yml b/META.yml index ea2399a..c8bfd90 100644 --- a/META.yml +++ b/META.yml @@ -35,4 +35,4 @@ resources: homepage: http://search.cpan.org/dist/Variable-Magic/ license: http://dev.perl.org/licenses/ repository: http://git.profvince.com/?p=perl%2Fmodules%2FVariable-Magic.git -version: 0.51 +version: 0.52 diff --git a/README b/README index a7c0959..e04ba96 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Variable::Magic - Associate user-defined magic to variables from Perl. VERSION - Version 0.51 + Version 0.52 SYNOPSIS use Variable::Magic qw; @@ -100,11 +100,19 @@ DESCRIPTION * *len* - This magic only applies to scalars and arrays, and is triggered when - the 'size' or the 'length' of the variable has to be known by Perl. - This is typically the magic involved when an array is evaluated in - scalar context, but also on array assignment and loops ("for", "map" - or "grep"). The length is returned from the callback as an integer. + This magic only applies to arrays (though it used to also apply to + scalars), and is triggered when the 'size' or the 'length' of the + variable has to be known by Perl. This is typically the magic + involved when an array is evaluated in scalar context, but also on + array assignment and loops ("for", "map" or "grep"). The length is + returned from the callback as an integer. + + Starting from perl 5.12, this magic is no longer called by the + "length" keyword, and starting from perl 5.17.4 it is also no longer + called for scalars in any situation, making this magic only + meaningful on arrays. You can use the constants + "VMG_COMPAT_SCALAR_LENGTH_NOLEN" and "VMG_COMPAT_SCALAR_NOLEN" to + see if this magic is available for scalars or not. * *clear* @@ -353,6 +361,10 @@ CONSTANTS True for perls that don't call *len* magic when taking the "length" of a magical scalar. + "VMG_COMPAT_SCALAR_NOLEN" + True for perls that don't call *len* magic on scalars. Implies + "VMG_COMPAT_SCALAR_LENGTH_NOLEN". + "VMG_COMPAT_ARRAY_PUSH_NOLEN" True for perls that don't call *len* magic when you push an element in a magical array. Starting from perl 5.11.0, this only refers to pushes in diff --git a/lib/Variable/Magic.pm b/lib/Variable/Magic.pm index 47ed91a..7f8cedb 100644 --- a/lib/Variable/Magic.pm +++ b/lib/Variable/Magic.pm @@ -11,13 +11,13 @@ Variable::Magic - Associate user-defined magic to variables from Perl. =head1 VERSION -Version 0.51 +Version 0.52 =cut our $VERSION; BEGIN { - $VERSION = '0.51'; + $VERSION = '0.52'; } =head1 SYNOPSIS