Revision history for Variable-Magic
+0.29 2009-02-08 11:10 UTC
+ + Add : Set $_[2] to the default length for len magic on scalars.
+ + Chg : Perl 5.8 is required.
+ + Chg : The CLONE method will no longer be defined for non-threaded
+ perls.
+ + Doc : Nits.
+ + Fix : The logic for turning off the GMAGICAL flag on hashes when no
+ uvar magic is involved could do nasty things on tied hashes.
+ + Upd : More resources in META.yml.
+
0.28 2009-01-24 17:05 UTC
+ Add : The 'copy_key' option to wizard(), that enables the safe edition
of $_[2] in uvar callbacks to redirect actions to another key.
--- #YAML:1.0
name: Variable-Magic
-version: 0.28
+version: 0.29
abstract: Associate user-defined magic to variables from Perl.
author:
- Vincent Pit <perl@profvince.com>
license: perl
distribution_type: module
configure_requires:
+ Config: 0
ExtUtils::MakeMaker: 0
+build_requires:
+ Config: 0
+ ExtUtils::MakeMaker: 0
+ Test::More: 0
requires:
Carp: 0
Exporter: 0
+ perl: 5.008
XSLoader: 0
+resources:
+ bugtracker: http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Variable-Magic
+ homepage: http://search.cpan.org/dist/Variable-Magic/
+ license: http://dev.perl.org/licenses/
+ repository: http://git.profvince.com/perl/modules/Variable-Magic.git
no_index:
directory:
- t
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
-build_requires:
- Config: 0
- ExtUtils::MakeMaker: 0
- Test::More: 0
-resources:
- bugtracker: http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Variable-Magic
- repository: http://git.profvince.com/perl/modules/Variable-Magic.git
Variable::Magic - Associate user-defined magic to variables from Perl.
VERSION
- Version 0.28
+ Version 0.29
SYNOPSIS
use Variable::Magic qw/wizard cast dispell/;
(or "undef" when no private data constructor was supplied). Other
arguments are specific to the magic hooked :
- - "len"
+ * "len"
- When the variable is an array, $_[2] contains the normal
- length. The callback is also expected to return the new
- scalar or array length.
+ When the variable is an array or a scalar, $_[2] contains
+ the non-magical length. The callback can return the new
+ scalar or array length to use, or "undef" to default to the
+ normal length.
- - "copy"
+ * "copy"
$_[2] is a either a copy or an alias of the current key,
which means that it is useless to try to change or cast
magic on it. $_[3] is an alias to the current element (i.e.
the value).
- - "fetch", "store", "exists" and "delete"
+ * "fetch", "store", "exists" and "delete"
$_[2] is an alias to the current key. Nothing prevents you
from changing it, but be aware that there lurk dangerous
first.
DEPENDENCIES
- perl 5.7.3.
+ perl 5.8.
Carp (standard since perl 5), XSLoader (standard since perl 5.006).