Subject: | Anon classes are destroyed when their meta class goes out of scope (most probable a documentation bug) |
The docs for Class::MOP::Class->create_anon_class state:
This will create an anonymous class, it works much like "create"
but it does not need a $package_name. Instead it
will create a suitably unique package name for you
to stash things into.
This is misleading, as there is another vital difference: anon classes
are destroyed (at least in my setup) when their meta class goes out of
scope, thus leading to very strange bugs down the road if you are not
aware of this behavior.