This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #127494] don't cache AUTOLOAD as DESTROY
Otherwise S_curse() would need to do all the work gv_autoload_pvn()
already does to set up to call AUTOLOAD() (setting $AUTOLOAD etc.)
Instead, by not caching it, we ensure gv_autoload_pvn() is called
each time to perform the required setup.
This has a performance cost over adding that code to S_curse(), but the
cost of actually running the AUTOLOAD sub is likely to drown that out,
and is easily avoided by adding "sub DESTROY {}" to the module.