From: Vincent Pit Date: Mon, 22 Sep 2014 17:30:47 +0000 (+0200) Subject: This is 0.54 X-Git-Tag: v0.54^0 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Magic.git;a=commitdiff_plain;h=3f061fdc6fe7977e19a17d0a67a161462bf147f2 This is 0.54 --- diff --git a/Changes b/Changes index 5745f37..f8a833d 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,18 @@ Revision history for Variable-Magic +0.54 2014-09-22 17:30 UTC + + Add : The new constant VMG_COMPAT_CODE_COPY_CLONE evaluates to true + if your perl calls 'copy' magic when a magical code prototype + is cloned, which is currently the case for perl 5.17.0 and + above. + + Fix : [RT #90205] : copy magic on subs puts raw CV in $_[3] + $_[3] will now contain a reference to the cloned code when + 'copy' magic is called for a coderef. + Thanks Lukas Mai for reporting. + + Fix : t/35-stash.t has been taught about perl 5.21.4. + + Fix : Tests using run_perl() in t/17-ctl.t will no longer fail on + Android. + 0.53 2013-09-01 17:50 UTC This is a maintenance release. The code contains no functional change. Satisfied users of version 0.52 can skip this update. diff --git a/META.json b/META.json index 6d090d3..4e95a78 100644 --- a/META.json +++ b/META.json @@ -4,7 +4,7 @@ "Vincent Pit " ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921", + "generated_by" : "ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142060", "license" : [ "perl_5" ], @@ -60,5 +60,5 @@ "url" : "http://git.profvince.com/?p=perl%2Fmodules%2FVariable-Magic.git" } }, - "version" : "0.53" + "version" : "0.54" } diff --git a/META.yml b/META.yml index 6ccb80e..8662de5 100644 --- a/META.yml +++ b/META.yml @@ -3,36 +3,36 @@ abstract: 'Associate user-defined magic to variables from Perl.' author: - 'Vincent Pit ' build_requires: - Carp: 0 - Config: 0 - Exporter: 0 - ExtUtils::MakeMaker: 0 - Test::More: 0 - XSLoader: 0 - base: 0 + Carp: '0' + Config: '0' + Exporter: '0' + ExtUtils::MakeMaker: '0' + Test::More: '0' + XSLoader: '0' + base: '0' configure_requires: - Config: 0 - ExtUtils::MakeMaker: 0 + Config: '0' + ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 6.66, CPAN::Meta::Converter version 2.120921' +generated_by: 'ExtUtils::MakeMaker version 6.98, CPAN::Meta::Converter version 2.142060' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 + version: '1.4' name: Variable-Magic no_index: directory: - t - inc requires: - Carp: 0 - Exporter: 0 - XSLoader: 0 - base: 0 - perl: 5.008 + Carp: '0' + Exporter: '0' + XSLoader: '0' + base: '0' + perl: '5.008' resources: bugtracker: http://rt.cpan.org/Dist/Display.html?Name=Variable-Magic 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.53 +version: '0.54' diff --git a/README b/README index b77b845..23db4c3 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Variable::Magic - Associate user-defined magic to variables from Perl. VERSION - Version 0.53 + Version 0.54 SYNOPSIS use Variable::Magic qw; @@ -132,8 +132,13 @@ DESCRIPTION * *copy* - This magic only applies to tied arrays and hashes, and fires when - you try to access or change their elements. + When applied to tied arrays and hashes, this magic fires when you + try to access or change their elements. + + Starting from perl 5.17.0, it can also be applied to closure + prototypes, in which case the magic will be called when the + prototype is cloned. The "VMG_COMPAT_CODE_COPY_CLONE" constant is + true when your perl support this feature. * *dup* @@ -225,10 +230,15 @@ FUNCTIONS * *copy* - $_[2] is a either an alias or a copy of the current key, and - $_[3] is an alias to the current element (i.e. the value). - Because $_[2] might be a copy, it is useless to try to - change it or cast magic on it. + When the variable for which the magic is invoked is an array + or an hash, $_[2] is a either an alias or a copy of the + current key, and $_[3] is an alias to the current element + (i.e. the value). Since $_[2] might be a copy, it is useless + to try to change it or cast magic on it. + + Starting from perl 5.17.0, this magic can also be called for + code references. In this case, $_[2] is always "undef" and + $_[3] is a reference to the cloned anonymous subroutine. * *fetch*, *store*, *exists* and *delete* @@ -385,6 +395,10 @@ CONSTANTS True for perls that don't call *delete* magic when you delete an element from a hash in void context. + "VMG_COMPAT_CODE_COPY_CLONE" + True for perls that call *copy* magic when a magical closure prototype + is cloned. + "VMG_COMPAT_GLOB_GET" True for perls that call *get* magic for operations on globs. @@ -593,8 +607,8 @@ SUPPORT . COPYRIGHT & LICENSE - Copyright 2007,2008,2009,2010,2011,2012,2013 Vincent Pit, all rights - reserved. + Copyright 2007,2008,2009,2010,2011,2012,2013,2014 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/Variable/Magic.pm b/lib/Variable/Magic.pm index e37984b..1be2bf1 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.53 +Version 0.54 =cut our $VERSION; BEGIN { - $VERSION = '0.53'; + $VERSION = '0.54'; } =head1 SYNOPSIS