X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FVariable%2FMagic.pm;h=954297ea489a64cef8af1fbf72dfe91cde36a583;hb=1ff75d21f8a370b6533873480725f78eebd70efc;hp=db71e5e0e625a457d48f967f7b917acb6e1258dd;hpb=2cb1dced4bb9a9898138c0ca3d6be8e103fa36c1;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/lib/Variable/Magic.pm b/lib/Variable/Magic.pm index db71e5e..954297e 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.33 +Version 0.36 =cut our $VERSION; BEGIN { - $VERSION = '0.33'; + $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; @@ -471,6 +473,11 @@ The perl patchlevel this module was built with, or C<0> for non-debugging perls. True iff this module could have been built with thread-safety features enabled. +=head2 C + +True iff this module could have been built with fork-safety features enabled. +This will always be true except on Windows where it's false for perl 5.10.0 and below . + =head2 C Value to pass with C to get the current op name in the magic callbacks. @@ -552,7 +559,7 @@ our %EXPORT_TAGS = ( qw/SIG_MIN SIG_MAX SIG_NBR MGf_COPY MGf_DUP MGf_LOCAL VMG_UVAR/, qw/VMG_COMPAT_ARRAY_PUSH_NOLEN VMG_COMPAT_ARRAY_UNSHIFT_NOLEN_VOID VMG_COMPAT_ARRAY_UNDEF_CLEAR VMG_COMPAT_SCALAR_LENGTH_NOLEN/, qw/VMG_PERL_PATCHLEVEL/, - qw/VMG_THREADSAFE/, + qw/VMG_THREADSAFE VMG_FORKSAFE/, qw/VMG_OP_INFO_NAME VMG_OP_INFO_OBJECT/ ] );