X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=lib%2FVariable%2FMagic.pm;h=e09ef044d5bd767c239fdc74f5f50ab5bca4829b;hb=4d390b48e044d734803433486830972416f03d59;hp=27e482c33c19639b6204c9b87317aa0b9fc740f3;hpb=dac7b385e4b34971fd89539cc13c2ecfc0af37c0;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/lib/Variable/Magic.pm b/lib/Variable/Magic.pm index 27e482c..e09ef04 100644 --- a/lib/Variable/Magic.pm +++ b/lib/Variable/Magic.pm @@ -423,6 +423,15 @@ If the variable isn't a hash, any C callback of the wizard is safely ignor my $x; die 'error' unless cast $x, $wiz; +The C argument can be an array or hash value. +Magic for those behaves like for any other scalar, except that it is dispelled when the entry is deleted from the container. +For example, if you want to call C each time the C<'TZ'> environment variable is changed in C<%ENV>, you can use : + + use POSIX; + cast $ENV{TZ}, wizard set => sub { POSIX::tzset(); () }; + +If you want to overcome the possible deletion of the C<'TZ'> entry, you have no choice but to rely on C uvar magic. + =head2 C getdata [$@%&*]var, [$wiz|$sig]