X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FVariable%2FMagic.pm;h=1ac6898022a72d1c6d27eba58a6e8efc4588049f;hb=a5f1caf2861bd8eac71acfec7ebaae65a08e076c;hp=b588e88070fb5f6d6ef56de515d24e4d69fd5f4c;hpb=b9df7824d4619174e28f9b1b5856c4a228d9cc7b;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/lib/Variable/Magic.pm b/lib/Variable/Magic.pm index b588e88..1ac6898 100644 --- a/lib/Variable/Magic.pm +++ b/lib/Variable/Magic.pm @@ -13,13 +13,13 @@ Variable::Magic - Associate user-defined magic to variables from Perl. =head1 VERSION -Version 0.32 +Version 0.36 =cut our $VERSION; BEGIN { - $VERSION = '0.32'; + $VERSION = '0.36'; } =head1 SYNOPSIS @@ -105,13 +105,15 @@ The operations that can be overloaded are : C -This magic is invoked when the variable is evaluated (does not include array/hash subscripts and slices). +This magic is invoked when the variable is evaluated. +It is never called for arrays and hashes. =item * C -This one is triggered each time the value of the variable changes (includes array/hash subscripts and slices). +This one is triggered each time the value of the variable changes. +It is called for array subscripts and slices, but never for hashes. =item * @@ -278,7 +280,7 @@ C, C, C and C C<$_[2]> is an alias to the current key. Nothing prevents you from changing it, but be aware that there lurk dangerous side effects. -For example, it may righteously be readonly if the key was a bareword. +For example, it may rightfully be readonly if the key was a bareword. You can get a copy instead by passing C<< copy_key => 1 >> to L, which allows you to safely assign to C<$_[2]> in order to e.g. redirect the action to another key. This however has a little performance drawback because of the copy. @@ -401,7 +403,7 @@ Of course, this example does nothing with the values that are added after the C< getdata [$@%&*]var, [$wiz|$sig] This accessor fetches the private data associated with the magic C<$wiz> (or the signature C<$sig>) in the variable. -It croaks when C<$wiz> or C<$sig> do not represent a current valid magic object attached to the variable, and returns C when the wizard has no data constructor or when the data is actually C. +It croaks when C<$wiz> or C<$sig> do not represent a valid magic object, and returns an empty list if no such magic is attached to the variable or when the wizard has no data constructor. # Get the attached data, or undef if the wizard does not attach any. my $data = getdata $x, $wiz;