David Golden wrote: > I don't know that we should attempt to write a general hook when 99% > of cases to date are version.pm. I think we just need to be smarter > about the specific places in META.yml that could contain a version > number.
What I really wish is that classes could register a callback into YAML to handle their own serialize method (YAML_freeze/YAML_thaw strikes me as a good suggestions). This is not the first time I've been annoyed with the various Perl YAML implementations extremely shortsighted design. Oddly enough, Storable has exactly this interface with STORABLE_freeze/STORABLE_thaw. Unlike some languages, Perl has objects and so YAML on Perl needs to cope with them in some more sophisticated way than just spewing forth the underlying representation. It should never be the job of the class calling YAML (Module::Build here) to know how to serialize random objects; rather it should up to the individual object class to provide a method to serialize its own objects if appropriate. And since YAML is doing the serializing, it should be the one asking the class. That being said, the last time we fixed this in M::B was to force module versions to be stringified; we should do the same here. There aren't that many places in M::B where you can specify a version... John