From: Vincent Pit Date: Sat, 18 Aug 2012 14:33:43 +0000 (+0200) Subject: Documentation tweaks X-Git-Tag: v0.51~1 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Magic.git;a=commitdiff_plain;h=4817a150722f1900424bd23dc474f399ed647c3c Documentation tweaks In particular, document how 'free' callbacks propagate exceptions. --- diff --git a/lib/Variable/Magic.pm b/lib/Variable/Magic.pm index b3b7316..5b2086b 100644 --- a/lib/Variable/Magic.pm +++ b/lib/Variable/Magic.pm @@ -79,6 +79,12 @@ This also makes catching individual events easier than with C, where you ha =item * +Magic is multivalued. + +You can safely apply different kinds of magics to the same variable, and each of them will be invoked successively. + +=item * + Magic is type-agnostic. The same magic can be applied on scalars, arrays, hashes, subs or globs. @@ -86,7 +92,7 @@ But the same hook (see below for a list) may trigger differently depending on th =item * -Magic is invisible at the Perl level. +Magic is invisible at Perl level. Magical and non-magical variables cannot be distinguished with C, C or another trick. @@ -136,7 +142,8 @@ Please note that this is different from undefining the variable, even though the I -This magic is called when an object is destroyed as the result of the variable going out of scope (but not when the variable is undefined). +This magic is called when a variable is destroyed as the result of going out of scope (but not when it is undefined). +It behaves roughly like Perl object destructors (i.e. C methods), except that exceptions thrown from inside a I callback will always be propagated to the surrounding code. =item *