+ These callbacks are executed in scalar context and are expected to
+ return an integer, which is then passed straight to the perl magic
+ API. However, only the return value of the *len* magic callback
+ currently holds a meaning.
+
+ Each callback can be specified as :
+
+ * a code reference, which will be called as a subroutine.
+
+ * a string reference, where the string denotes which subroutine is to
+ be called when magic is triggered. If the subroutine name is not
+ fully qualified, then the current package at the time the magic is
+ invoked will be used instead.
+
+ * a reference to "undef", in which case a no-op magic callback is
+ installed instead of the default one. This may especially be helpful
+ for *local* magic, where an empty callback prevents magic from being
+ copied during localization.
+
+ Note that *free* magic is never called during global destruction, as
+ there is no way to ensure that the wizard object and the callback were
+ not destroyed before the variable.
+
+ Here is a simple usage example :
+
+ # A simple scalar tracer
+ my $wiz = wizard(
+ get => sub { print STDERR "got ${$_[0]}\n" },
+ set => sub { print STDERR "set to ${$_[0]}\n" },
+ free => sub { print STDERR "${$_[0]} was deleted\n" },
+ );
+
+ "cast"
+ cast [$@%&*]var, $wiz, @args
+
+ This function associates $wiz magic to the supplied variable, without
+ overwriting any other kind of magic. It returns true on success or when
+ $wiz magic is already attached, and croaks on error. When $wiz provides
+ a data constructor, it is called just before magic is cast onto the
+ variable, and it receives a reference to the target variable in $_[0]
+ and the content of @args in @_[1 .. @args]. Otherwise, @args is ignored.
+
+ # Casts $wiz onto $x, passing (\$x, '1') to the data constructor.
+ my $x;
+ cast $x, $wiz, 1;
+
+ The "var" argument can be an array or hash value. Magic for these
+ scalars behaves like for any other, except that it is dispelled when the
+ entry is deleted from the container. For example, if you want to call
+ "POSIX::tzset" each time the 'TZ' environment variable is changed in
+ %ENV, you can use :
+
+ use POSIX;
+ cast $ENV{TZ}, wizard set => sub { POSIX::tzset(); () };
+
+ If you want to handle the possible deletion of the 'TZ' entry, you must
+ also specify *store* magic.
+
+ "getdata"
+ getdata [$@%&*]var, $wiz
+
+ This accessor fetches the private data associated with the magic $wiz in
+ the variable. It croaks when $wiz does 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 data attached to $wiz in $x, or undef if $wiz
+ # did not attach any.
+ my $data = getdata $x, $wiz;