- All the callbacks are expected to return an integer, which is passed
- straight to the perl magic API. However, only the return value of
- the "len" callback currently holds a meaning.
+ $_[-1] is the current op name.
+
+ * "VMG_OP_INFO_OBJECT"
+
+ $_[-1] is the "B::OP" object for the current op.
+
+ Both result in a small performance hit, but just getting the name is
+ lighter than getting the op object.
+
+ These callbacks are always executed in scalar context. The returned
+ value is coerced into a signed integer, which is then passed
+ straight to the perl magic API. However, note that perl currently
+ only cares about the return value of the *len* magic callback and
+ ignores all the others. Starting with Variable::Magic 0.58, a
+ reference returned from a non-*len* magic callback will not be
+ destroyed immediately but will be allowed to survive until the end
+ of the statement that triggered the magic. This lets you use this
+ return value as a token for triggering a destructor after the
+ original magic action takes place. You can see an example of this
+ technique in the cookbook.