Beyond not-supporting it, the other biggie is that this completely violates encapsulation.
Worse, since version.pm wasn't involved in the serialisation, any YAML parser that DID support this would just stuff a HASH full of the data you see there and blindly bless it into any class it's told. There's some caveats to that, sure, but that's the basics. There's code in YAML::Tiny you may wish to steal that checks for circular references and objects in the structure during writing, so that it will fail to write rather than generate something incorrect. You probably should be a little more subtle, but first checking for "supported" objects and flattening them in a known-good way, then applying the check after. Adam K 2009/5/18 Eric Wilhelm <scratchcomput...@gmail.com>: > # from Elliot Shank > # on Sunday 17 May 2009: > >>Adam's response: >>> This is a bug in Module::Build, it forgot to serialize the version >>> object in configure_requires before writing it into the META.yml. >>> >>> Module::Build should probably do this in the general case anyway, >>> objects shouldn't be getting past it into the file. >> >>So, what's the prevailing opinion on this? > > Right. > > configure_requires: > My::Module::Build: &1 !!perl/hash:version > original: v1.10.146560 > qv: 1 > version: > - 1 > - 10 > - 146560 > > I think that sort of object should never happen in META.yml, and > certainly not for a version number. > > I wonder: Can we put in a general-purpose hook to catch this kind of > thing, or do we have to just remember it whenever we add another new > might-be-an-object attribute? > > --Eric > -- > "...the bourgeoisie were hated from both ends: by the proles, because > they had all the money, and by the intelligentsia, because of their > tendency to spend it on lawn ornaments." > --Neal Stephenson > --------------------------------------------------- > http://scratchcomputing.com > --------------------------------------------------- >