{
    "content": [
        {
            "type": "text",
            "text": "# Variable::Magic (info)\n\n## NAME\n\nVariable::Magic - Associate user-defined magic to variables from Perl.\n\n## SYNOPSIS\n\nuse Variable::Magic qw<wizard cast VMGOPINFONAME>;\n{ # A variable tracer\nmy $wiz = wizard(\nset  => sub { print \"now set to ${$[0]}!\\n\" },\nfree => sub { print \"destroyed!\\n\" },\n);\nmy $a = 1;\ncast $a, $wiz;\n$a = 2;        # \"now set to 2!\"\n}               # \"destroyed!\"\n{ # A hash with a default value\nmy $wiz = wizard(\ndata     => sub { $[1] },\nfetch    => sub { $[2] = $[1] unless exists $[0]->{$[2]}; () },\nstore    => sub { print \"key $[2] stored in $[-1]\\n\" },\ncopykey => 1,\nopinfo  => VMGOPINFONAME,\n);\nmy %h = (default => 0, apple => 2);\ncast %h, $wiz, 'default';\nprint $h{banana}, \"\\n\"; # \"0\" (there is no 'banana' key in %h)\n$h{pear} = 1;           # \"key pear stored in helem\"\n}\n\n## DESCRIPTION\n\nMagic is Perl's way of enhancing variables.  This mechanism lets the\nuser add extra data to any variable and hook syntactical operations\n(such as access, assignment or destruction) that can be applied to it.\nWith this module, you can add your own magic to any variable without\nhaving to write a single line of XS.\n\n## Sections\n\n- **Variable::Magic(3pm)  User Contributed Perl Documentation Variable::Magic(3pm)**\n- **NAME**\n- **VERSION**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **FUNCTIONS**\n- **CONSTANTS**\n- **COOKBOOK**\n- **PERL MAGIC HISTORY**\n- **EXPORT**\n- **CAVEATS**\n- **DEPENDENCIES**\n- **SEE ALSO**\n- **AUTHOR**\n- **BUGS**\n- **SUPPORT**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Variable::Magic",
        "section": "",
        "mode": "info",
        "summary": "Variable::Magic - Associate user-defined magic to variables from Perl.",
        "synopsis": "use Variable::Magic qw<wizard cast VMGOPINFONAME>;\n{ # A variable tracer\nmy $wiz = wizard(\nset  => sub { print \"now set to ${$[0]}!\\n\" },\nfree => sub { print \"destroyed!\\n\" },\n);\nmy $a = 1;\ncast $a, $wiz;\n$a = 2;        # \"now set to 2!\"\n}               # \"destroyed!\"\n{ # A hash with a default value\nmy $wiz = wizard(\ndata     => sub { $[1] },\nfetch    => sub { $[2] = $[1] unless exists $[0]->{$[2]}; () },\nstore    => sub { print \"key $[2] stored in $[-1]\\n\" },\ncopykey => 1,\nopinfo  => VMGOPINFONAME,\n);\nmy %h = (default => 0, apple => 2);\ncast %h, $wiz, 'default';\nprint $h{banana}, \"\\n\"; # \"0\" (there is no 'banana' key in %h)\n$h{pear} = 1;           # \"key pear stored in helem\"\n}",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "Variable::Magic(3pm)  User Contributed Perl Documentation Variable::Magic(3pm)",
                "lines": 1,
                "subsections": []
            },
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "VERSION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 28,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 143,
                "subsections": []
            },
            {
                "name": "FUNCTIONS",
                "lines": 180,
                "subsections": []
            },
            {
                "name": "CONSTANTS",
                "lines": 76,
                "subsections": []
            },
            {
                "name": "COOKBOOK",
                "lines": 116,
                "subsections": []
            },
            {
                "name": "PERL MAGIC HISTORY",
                "lines": 45,
                "subsections": []
            },
            {
                "name": "EXPORT",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "CAVEATS",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "DEPENDENCIES",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "SUPPORT",
                "lines": 12,
                "subsections": []
            }
        ],
        "sections": {
            "Variable::Magic(3pm)  User Contributed Perl Documentation Variable::Magic(3pm)": {
                "content": "",
                "subsections": []
            },
            "NAME": {
                "content": "Variable::Magic - Associate user-defined magic to variables from Perl.\n",
                "subsections": []
            },
            "VERSION": {
                "content": "Version 0.62\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Variable::Magic qw<wizard cast VMGOPINFONAME>;\n\n{ # A variable tracer\nmy $wiz = wizard(\nset  => sub { print \"now set to ${$[0]}!\\n\" },\nfree => sub { print \"destroyed!\\n\" },\n);\n\nmy $a = 1;\ncast $a, $wiz;\n$a = 2;        # \"now set to 2!\"\n}               # \"destroyed!\"\n\n{ # A hash with a default value\nmy $wiz = wizard(\ndata     => sub { $[1] },\nfetch    => sub { $[2] = $[1] unless exists $[0]->{$[2]}; () },\nstore    => sub { print \"key $[2] stored in $[-1]\\n\" },\ncopykey => 1,\nopinfo  => VMGOPINFONAME,\n);\n\nmy %h = (default => 0, apple => 2);\ncast %h, $wiz, 'default';\nprint $h{banana}, \"\\n\"; # \"0\" (there is no 'banana' key in %h)\n$h{pear} = 1;           # \"key pear stored in helem\"\n}\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "Magic is Perl's way of enhancing variables.  This mechanism lets the\nuser add extra data to any variable and hook syntactical operations\n(such as access, assignment or destruction) that can be applied to it.\nWith this module, you can add your own magic to any variable without\nhaving to write a single line of XS.\n\nYou'll realize that these magic variables look a lot like tied\nvariables.  It is not surprising, as tied variables are implemented as\na special kind of magic, just like any 'irregular' Perl variable :\nscalars like $!, $( or $^W, the %ENV and %SIG hashes, the @ISA array,\n\"vec()\" and \"substr()\" lvalues, threads::shared variables...  They all\nshare the same underlying C API, and this module gives you direct\naccess to it.\n\nStill, the magic made available by this module differs from tieing and\noverloading in several ways :\n\no   Magic is not copied on assignment.\n\nYou attach it to variables, not values (as for blessed references).\n\no   Magic does not replace the original semantics.\n\nMagic callbacks usually get triggered before the original action\ntakes place, and cannot prevent it from happening.  This also makes\ncatching individual events easier than with \"tie\", where you have\nto provide fallbacks methods for all actions by usually inheriting\nfrom the correct \"Tie::Std*\" class and overriding individual\nmethods in your own class.\n\no   Magic is multivalued.\n\nYou can safely apply different kinds of magics to the same\nvariable, and each of them will be invoked successively.\n\no   Magic is type-agnostic.\n\nThe same magic can be applied on scalars, arrays, hashes, subs or\nglobs.  But the same hook (see below for a list) may trigger\ndifferently depending on the type of the variable.\n\no   Magic is invisible at Perl level.\n\nMagical and non-magical variables cannot be distinguished with\n\"ref\", \"tied\" or another trick.\n\no   Magic is notably faster.\n\nMainly because perl's way of handling magic is lighter by nature,\nand because there is no need for any method resolution.  Also,\nsince you don't have to reimplement all the variable semantics, you\nonly pay for what you actually use.\n\nThe operations that can be overloaded are :\n\no   get\n\nThis magic is invoked when the variable is evaluated.  It is never\ncalled for arrays and hashes.\n\no   set\n\nThis magic is called each time the value of the variable changes.\nIt is called for array subscripts and slices, but never for hashes.\n\no   len\n\nThis magic only applies to arrays (though it used to also apply to\nscalars), and is triggered when the 'size' or the 'length' of the\nvariable has to be known by Perl.  This is typically the magic\ninvolved when an array is evaluated in scalar context, but also on\narray assignment and loops (\"for\", \"map\" or \"grep\").  The length is\nreturned from the callback as an integer.\n\nStarting from perl 5.12, this magic is no longer called by the\n\"length\" keyword, and starting from perl 5.17.4 it is also no\nlonger called for scalars in any situation, making this magic only\nmeaningful on arrays.  You can use the constants\n\"VMGCOMPATSCALARLENGTHNOLEN\" and \"VMGCOMPATSCALARNOLEN\" to\nsee if this magic is available for scalars or not.\n\no   clear\n\nThis magic is invoked when the variable is reset, such as when an\narray is emptied.  Please note that this is different from\nundefining the variable, even though the magic is called when the\nclearing is a result of the undefine (e.g. for an array, but\nactually a bug prevent it to work before perl 5.9.5 - see the\nhistory).\n\no   free\n\nThis magic is called when a variable is destroyed as the result of\ngoing out of scope (but not when it is undefined).  It behaves\nroughly like Perl object destructors (i.e. \"DESTROY\" methods),\nexcept that exceptions thrown from inside a free callback will\nalways be propagated to the surrounding code.\n\no   copy\n\nWhen applied to tied arrays and hashes, this magic fires when you\ntry to access or change their elements.\n\nStarting from perl 5.17.0, it can also be applied to closure\nprototypes, in which case the magic will be called when the\nprototype is cloned.  The \"VMGCOMPATCODECOPYCLONE\" constant is\ntrue when your perl support this feature.\n\no   dup\n\nThis magic is invoked when the variable is cloned across threads.\nIt is currently not available.\n\no   local\n\nWhen this magic is set on a variable, all subsequent localizations\nof the variable will trigger the callback.  It is available on your\nperl if and only if \"MGfLOCAL\" is true.\n\nThe following actions only apply to hashes and are available if and\nonly if \"VMGUVAR\" is true.  They are referred to as uvar magics.\n\no   fetch\n\nThis magic is invoked each time an element is fetched from the\nhash.\n\no   store\n\nThis one is called when an element is stored into the hash.\n\no   exists\n\nThis magic fires when a key is tested for existence in the hash.\n\no   delete\n\nThis magic is triggered when a key is deleted in the hash,\nregardless of whether the key actually exists in it.\n\nYou can refer to the tests to have more insight of where the different\nmagics are invoked.\n",
                "subsections": []
            },
            "FUNCTIONS": {
                "content": "\"wizard\"\nwizard(\ndata     => sub { ... },\nget      => sub { my ($ref, $data [, $op]) = @; ... },\nset      => sub { my ($ref, $data [, $op]) = @; ... },\nlen      => sub {\nmy ($ref, $data, $len [, $op]) = @; ... ; return $newlen\n},\nclear    => sub { my ($ref, $data [, $op]) = @; ... },\nfree     => sub { my ($ref, $data [, $op]) = @, ... },\ncopy     => sub { my ($ref, $data, $key, $elt [, $op]) = @; ... },\nlocal    => sub { my ($ref, $data [, $op]) = @; ... },\nfetch    => sub { my ($ref, $data, $key [, $op]) = @; ... },\nstore    => sub { my ($ref, $data, $key [, $op]) = @; ... },\nexists   => sub { my ($ref, $data, $key [, $op]) = @; ... },\ndelete   => sub { my ($ref, $data, $key [, $op]) = @; ... },\ncopykey => $bool,\nopinfo  => [ 0 | VMGOPINFONAME | VMGOPINFOOBJECT ],\n)\n\nThis function creates a 'wizard', an opaque object that holds the magic\ninformation.  It takes a list of keys / values as argument, whose keys\ncan be :\n\no   \"data\"\n\nA code (or string) reference to a private data constructor.  It is\ncalled in scalar context each time the magic is cast onto a\nvariable, with $[0] being a reference to this variable and @[1 ..\n@-1] being all extra arguments that were passed to \"cast\".  The\nscalar returned from this call is then attached to the variable and\ncan be retrieved later with \"getdata\".\n\no   \"get\", \"set\", \"len\", \"clear\", \"free\", \"copy\", \"local\", \"fetch\",\n\"store\", \"exists\" and \"delete\"\n\nCode (or string) references to the respective magic callbacks.  You\ndon't have to specify all of them : the magic corresponding to\nundefined entries will simply not be hooked.\n\nWhen those callbacks are executed, $[0] is a reference to the\nmagic variable and $[1] is the associated private data (or \"undef\"\nwhen no private data constructor is supplied with the wizard).\nOther arguments depend on which kind of magic is involved :\n\no       len\n\n$[2] contains the natural, non-magical length of the\nvariable (which can only be a scalar or an array as len\nmagic is only relevant for these types).  The callback is\nexpected to return the new scalar or array length to use,\nor \"undef\" to default to the normal length.\n\no       copy\n\nWhen the variable for which the magic is invoked is an\narray or an hash, $[2] is a either an alias or a copy of\nthe current key, and $[3] is an alias to the current\nelement (i.e. the value).  Since $[2] might be a copy, it\nis useless to try to change it or cast magic on it.\n\nStarting from perl 5.17.0, this magic can also be called\nfor code references.  In this case, $[2] is always \"undef\"\nand $[3] is a reference to the cloned anonymous\nsubroutine.\n\no       fetch, store, exists and delete\n\n$[2] is an alias to the current key.  Note that $[2] may\nrightfully be readonly if the key comes from a bareword,\nand as such it is unsafe to assign to it.  You can ask for\na copy instead by passing \"copykey => 1\" to \"wizard\"\nwhich, at the price of a small performance hit, allows you\nto safely assign to $[2] in order to e.g. redirect the\naction to another key.\n\nFinally, if \"opinfo => $num\" is also passed to \"wizard\", then one\nextra element is appended to @.  Its nature depends on the value\nof $num :\n\no       \"VMGOPINFONAME\"\n\n$[-1] is the current op name.\n\no       \"VMGOPINFOOBJECT\"\n\n$[-1] is the \"B::OP\" object for the current op.\n\nBoth result in a small performance hit, but just getting the name\nis lighter than getting the op object.\n\nThese callbacks are always executed in scalar context.  The\nreturned value is coerced into a signed integer, which is then\npassed straight to the perl magic API.  However, note that perl\ncurrently only cares about the return value of the len magic\ncallback and ignores all the others.  Starting with Variable::Magic\n0.58, a reference returned from a non-len magic callback will not\nbe destroyed immediately but will be allowed to survive until the\nend of the statement that triggered the magic.  This lets you use\nthis return value as a token for triggering a destructor after the\noriginal magic action takes place.  You can see an example of this\ntechnique in the cookbook.\n\nEach callback can be specified as :\n\no   a code reference, which will be called as a subroutine.\n\no   a string reference, where the string denotes which subroutine is to\nbe called when magic is triggered.  If the subroutine name is not\nfully qualified, then the current package at the time the magic is\ninvoked will be used instead.\n\no   a reference to \"undef\", in which case a no-op magic callback is\ninstalled instead of the default one.  This may especially be\nhelpful for local magic, where an empty callback prevents magic\nfrom being copied during localization.\n\nNote that free magic is never called during global destruction, as\nthere is no way to ensure that the wizard object and the callback were\nnot destroyed before the variable.\n\nHere is a simple usage example :\n\n# A simple scalar tracer\nmy $wiz = wizard(\nget  => sub { print STDERR \"got ${$[0]}\\n\" },\nset  => sub { print STDERR \"set to ${$[0]}\\n\" },\nfree => sub { print STDERR \"${$[0]} was deleted\\n\" },\n);\n\n\"cast\"\ncast [$@%&*]var, $wiz, @args\n\nThis function associates $wiz magic to the supplied variable, without\noverwriting any other kind of magic.  It returns true on success or\nwhen $wiz magic is already attached, and croaks on error.  When $wiz\nprovides a data constructor, it is called just before magic is cast\nonto the variable, and it receives a reference to the target variable\nin $[0] and the content of @args in @[1 .. @args].  Otherwise, @args\nis ignored.\n\n# Casts $wiz onto $x, passing (\\$x, '1') to the data constructor.\nmy $x;\ncast $x, $wiz, 1;\n\nThe \"var\" argument can be an array or hash value.  Magic for these\nscalars behaves like for any other, except that it is dispelled when\nthe entry is deleted from the container.  For example, if you want to\ncall \"POSIX::tzset\" each time the 'TZ' environment variable is changed\nin %ENV, you can use :\n\nuse POSIX;\ncast $ENV{TZ}, wizard set => sub { POSIX::tzset(); () };\n\nIf you want to handle the possible deletion of the 'TZ' entry, you must\nalso specify store magic.\n\n\"getdata\"\ngetdata [$@%&*]var, $wiz\n\nThis accessor fetches the private data associated with the magic $wiz\nin the variable.  It croaks when $wiz does not represent a valid magic\nobject, and returns an empty list if no such magic is attached to the\nvariable or when the wizard has no data constructor.\n\n# Get the data attached to $wiz in $x, or undef if $wiz\n# did not attach any.\nmy $data = getdata $x, $wiz;\n\n\"dispell\"\ndispell [$@%&*]variable, $wiz\n\nThe exact opposite of \"cast\" : it dissociates $wiz magic from the\nvariable.  This function returns true on success, 0 when no magic\nrepresented by $wiz could be found in the variable, and croaks if the\nsupplied wizard is invalid.\n\n# Dispell now.\ndie 'no such magic in $x' unless dispell $x, $wiz;\n",
                "subsections": []
            },
            "CONSTANTS": {
                "content": "\"MGfCOPY\"\nEvaluates to true if and only if the copy magic is available.  This is\nthe case for perl 5.7.3 and greater, which is ensured by the\nrequirements of this module.\n\n\"MGfDUP\"\nEvaluates to true if and only if the dup magic is available.  This is\nthe case for perl 5.7.3 and greater, which is ensured by the\nrequirements of this module.\n\n\"MGfLOCAL\"\nEvaluates to true if and only if the local magic is available.  This is\nthe case for perl 5.9.3 and greater.\n\n\"VMGUVAR\"\nWhen this constant is true, you can use the fetch, store, exists and\ndelete magics on hashes.  Initial \"VMGUVAR\" capability was introduced\nin perl 5.9.5, with a fully functional implementation shipped with perl\n5.10.0.\n\n\"VMGCOMPATSCALARLENGTHNOLEN\"\nTrue for perls that don't call len magic when taking the \"length\" of a\nmagical scalar.\n\n\"VMGCOMPATSCALARNOLEN\"\nTrue for perls that don't call len magic on scalars.  Implies\n\"VMGCOMPATSCALARLENGTHNOLEN\".\n\n\"VMGCOMPATARRAYPUSHNOLEN\"\nTrue for perls that don't call len magic when you push an element in a\nmagical array.  Starting from perl 5.11.0, this only refers to pushes\nin non-void context and hence is false.\n\n\"VMGCOMPATARRAYPUSHNOLENVOID\"\nTrue for perls that don't call len magic when you push in void context\nan element in a magical array.\n\n\"VMGCOMPATARRAYUNSHIFTNOLENVOID\"\nTrue for perls that don't call len magic when you unshift in void\ncontext an element in a magical array.\n\n\"VMGCOMPATARRAYUNDEFCLEAR\"\nTrue for perls that call clear magic when undefining magical arrays.\n\n\"VMGCOMPATHASHDELETENOUVARVOID\"\nTrue for perls that don't call delete magic when you delete an element\nfrom a hash in void context.\n\n\"VMGCOMPATCODECOPYCLONE\"\nTrue for perls that call copy magic when a magical closure prototype is\ncloned.\n\n\"VMGCOMPATGLOBGET\"\nTrue for perls that call get magic for operations on globs.\n\n\"VMGPERLPATCHLEVEL\"\nThe perl patchlevel this module was built with, or 0 for non-debugging\nperls.\n\n\"VMGTHREADSAFE\"\nTrue if and only if this module could have been built with thread-\nsafety features enabled.\n\n\"VMGFORKSAFE\"\nTrue if and only if this module could have been built with fork-safety\nfeatures enabled.  This is always true except on Windows where it is\nfalse for perl 5.10.0 and below.\n\n\"VMGOPINFONAME\"\nValue to pass with \"opinfo\" to get the current op name in the magic\ncallbacks.\n\n\"VMGOPINFOOBJECT\"\nValue to pass with \"opinfo\" to get a \"B::OP\" object representing the\ncurrent op in the magic callbacks.\n",
                "subsections": []
            },
            "COOKBOOK": {
                "content": "Associate an object to any perl variable\nThis technique can be useful for passing user data through limited\nAPIs.  It is similar to using inside-out objects, but without the\ndrawback of having to implement a complex destructor.\n\n{\npackage Magical::UserData;\n\nuse Variable::Magic qw<wizard cast getdata>;\n\nmy $wiz = wizard data => sub { \\$[1] };\n\nsub ud (\\[$@%*&]) : lvalue {\nmy ($var) = @;\nmy $data = &getdata($var, $wiz);\nunless (defined $data) {\n$data = \\(my $slot);\n&cast($var, $wiz, $slot)\nor die \"Couldn't cast UserData magic onto the variable\";\n}\n$$data;\n}\n}\n\n{\nBEGIN { *ud = \\&Magical::UserData::ud }\n\nmy $cb;\n$cb = sub { print 'Hello, ', ud(&$cb), \"!\\n\" };\n\nud(&$cb) = 'world';\n$cb->(); # Hello, world!\n}\n\nRecursively cast magic on datastructures\n\"cast\" can be called from any magical callback, and in particular from\n\"data\".  This allows you to recursively cast magic on datastructures :\n\nmy $wiz;\n$wiz = wizard data => sub {\nmy ($var, $depth) = @;\n$depth ||= 0;\nmy $r = ref $var;\nif ($r eq 'ARRAY') {\n&cast((ref() ? $ : \\$), $wiz, $depth + 1) for @$var;\n} elsif ($r eq 'HASH') {\n&cast((ref() ? $ : \\$), $wiz, $depth + 1) for values %$var;\n}\nreturn $depth;\n},\nfree => sub {\nmy ($var, $depth) = @;\nmy $r = ref $var;\nprint \"free $r at depth $depth\\n\";\n();\n};\n\n{\nmy %h = (\na => [ 1, 2 ],\nb => { c => 3 }\n);\ncast %h, $wiz;\n}\n\nWhen %h goes out of scope, this prints something among the lines of :\n\nfree HASH at depth 0\nfree HASH at depth 1\nfree SCALAR at depth 2\nfree ARRAY at depth 1\nfree SCALAR at depth 3\nfree SCALAR at depth 3\n\nOf course, this example does nothing with the values that are added\nafter the \"cast\".\n\nDelayed magic actions\nStarting with Variable::Magic 0.58, the return value of the magic\ncallbacks can be used to delay the action until after the original\naction takes place :\n\nmy $delayed;\nmy $delayedaux = wizard(\ndata => sub { $[1] },\nfree => sub {\nmy ($target) = $[1];\nmy $targetdata = &getdata($target, $delayed);\nlocal $targetdata->{guard} = 1;\nif (ref $target eq 'SCALAR') {\nmy $orig = $$target;\n$$target = $targetdata->{mangler}->($orig);\n}\nreturn;\n},\n);\n$delayed = wizard(\ndata => sub {\nreturn +{ guard => 0, mangler => $[1] };\n},\nset  => sub {\nreturn if $[1]->{guard};\nmy $token;\ncast $token, $delayedaux, $[0];\nreturn \\$token;\n},\n);\nmy $x = 1;\ncast $x, $delayed => sub { $[0] * 2 };\n$x = 2;\n# $x is now 4\n# But note that the delayed action only takes place at the end of the\n# current statement :\nmy @y = ($x = 5, $x);\n# $x is now 10, but @y is (5, 5)\n",
                "subsections": []
            },
            "PERL MAGIC HISTORY": {
                "content": "The places where magic is invoked have changed a bit through perl\nhistory.  Here is a little list of the most recent ones.\n\no   5.6.x\n\np14416 : copy and dup magic.\n\no   5.8.9\n\np28160 : Integration of p25854 (see below).\n\np32542 : Integration of p31473 (see below).\n\no   5.9.3\n\np25854 : len magic is no longer called when pushing an element into\na magic array.\n\np26569 : local magic.\n\no   5.9.5\n\np31064 : Meaningful uvar magic.\n\np31473 : clear magic was not invoked when undefining an array.  The\nbug is fixed as of this version.\n\no   5.10.0\n\nSince \"PERLMAGICuvar\" is uppercased, \"hvmagiccheck()\" triggers\ncopy magic on hash stores for (non-tied) hashes that also have uvar\nmagic.\n\no   5.11.x\n\np32969 : len magic is no longer invoked when calling \"length\" with\na magical scalar.\n\np34908 : len magic is no longer called when pushing / unshifting an\nelement into a magical array in void context.  The \"push\" part was\nalready covered by p25854.\n\ng9cdcb38b : len magic is called again when pushing into a magical\narray in non-void context.\n",
                "subsections": []
            },
            "EXPORT": {
                "content": "The functions \"wizard\", \"cast\", \"getdata\" and \"dispell\" are only\nexported on request.  All of them are exported by the tags ':funcs' and\n':all'.\n\nAll the constants are also only exported on request, either\nindividually or by the tags ':consts' and ':all'.\n",
                "subsections": []
            },
            "CAVEATS": {
                "content": "In order to hook hash operations with magic, you need at least perl\n5.10.0 (see \"VMGUVAR\").\n\nIf you want to store a magic object in the private data slot, you will\nnot be able to recover the magic with \"getdata\", since magic is not\ncopied by assignment.  You can work around this gotcha by storing a\nreference to the magic object instead.\n\nIf you define a wizard with free magic and cast it on itself, it\nresults in a memory cycle, so this destructor will not be called when\nthe wizard is freed.\n",
                "subsections": []
            },
            "DEPENDENCIES": {
                "content": "perl 5.8.\n\nA C compiler.  This module may happen to build with a C++ compiler as\nwell, but don't rely on it, as no guarantee is made in this regard.\n\nCarp (core since perl 5), XSLoader (since 5.6.0).\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "perlguts and perlapi for internal information about magic.\n\nperltie and overload for other ways of enhancing objects.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Vincent Pit, \"<perl at profvince.com>\", <http://www.profvince.com>.\n\nYou can contact me by mail or on \"irc.perl.org\" (vincent).\n",
                "subsections": []
            },
            "BUGS": {
                "content": "Please report any bugs or feature requests to \"bug-variable-magic at\nrt.cpan.org\", or through the web interface at\n<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Variable-Magic>.  I\nwill be notified, and then you'll automatically be notified of progress\non your bug as I make changes.\n",
                "subsections": []
            },
            "SUPPORT": {
                "content": "You can find documentation for this module with the perldoc command.\n\nperldoc Variable::Magic\n\nCOPYRIGHT & LICENSE\nCopyright 2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017\nVincent Pit, all rights reserved.\n\nThis program is free software; you can redistribute it and/or modify it\nunder the same terms as Perl itself.\n\nperl v5.34.0                      2022-02-06              Variable::Magic(3pm)",
                "subsections": []
            }
        }
    }
}