]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - lib/Variable/Magic.pm
Minor POD fix
[perl/modules/Variable-Magic.git] / lib / Variable / Magic.pm
index 70dff80801e7c27f31e022c022b759b4c475042d..aa7ee22136d71a0c31849f6a0dafed9f9d761431 100644 (file)
@@ -13,13 +13,13 @@ Variable::Magic - Associate user-defined magic to variables from Perl.
 
 =head1 VERSION
 
-Version 0.27
+Version 0.28
 
 =cut
 
 our $VERSION;
 BEGIN {
- $VERSION = '0.27';
+ $VERSION = '0.28';
 }
 
 =head1 SYNOPSIS
@@ -278,19 +278,20 @@ BEGIN {
 
 =head2 C<wizard>
 
-    wizard sig    => ...,
-           data   => sub { ... },
-           get    => sub { my ($ref, $data) = @_; ... },
-           set    => sub { my ($ref, $data) = @_; ... },
-           len    => sub { my ($ref, $data, $len) = @_; ... ; return $newlen; },
-           clear  => sub { my ($ref, $data) = @_; ... },
-           free   => sub { my ($ref, $data) = @_, ... },
-           copy   => sub { my ($ref, $data, $key, $elt) = @_; ... },
-           local  => sub { my ($ref, $data) = @_; ... },
-           fetch  => sub { my ($ref, $data, $key) = @_; ... },
-           store  => sub { my ($ref, $data, $key) = @_; ... },
-           exists => sub { my ($ref, $data, $key) = @_; ... },
-           delete => sub { my ($ref, $data, $key) = @_; ... }
+    wizard sig      => ...,
+           data     => sub { ... },
+           get      => sub { my ($ref, $data) = @_; ... },
+           set      => sub { my ($ref, $data) = @_; ... },
+           len      => sub { my ($ref, $data, $len) = @_; ... ; return $newlen; },
+           clear    => sub { my ($ref, $data) = @_; ... },
+           free     => sub { my ($ref, $data) = @_, ... },
+           copy     => sub { my ($ref, $data, $key, $elt) = @_; ... },
+           local    => sub { my ($ref, $data) = @_; ... },
+           fetch    => sub { my ($ref, $data, $key) = @_; ... },
+           store    => sub { my ($ref, $data, $key) = @_; ... },
+           exists   => sub { my ($ref, $data, $key) = @_; ... },
+           delete   => sub { my ($ref, $data, $key) = @_; ... },
+           copy_key => $bool
 
 This function creates a 'wizard', an opaque type that holds the magic information.
 It takes a list of keys / values as argument, whose keys can be :
@@ -324,21 +325,21 @@ Other arguments are specific to the magic hooked :
 
 =over 8
 
-=item -
+=item *
 
 C<len>
 
 When the variable is an array, C<$_[2]> contains the normal length.
 The callback is also expected to return the new scalar or array length.
 
-=item -
+=item *
 
 C<copy>
 
 C<$_[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.
 C<$_[3]> is an alias to the current element (i.e. the value).
 
-=item -
+=item *
 
 C<fetch>, C<store>, C<exists> and C<delete>
 
@@ -461,8 +462,6 @@ The only way to address this would be to return a reference.
 
 If you define a wizard with a C<free> callback and cast it on itself, this destructor won't be called because the wizard will be destroyed first.
 
-Using simultaneously C<get> and C<clear> magics on hashes may cause segfaults.
-
 =head1 DEPENDENCIES
 
 L<perl> 5.7.3.