Attempts to guess which package an unblessed hash or hashref should be blessed into and bless it into that package on the fly.

Guessing is done by the fields (hash keys) present in the unblessed hash versus the fields in instances of various objects in memory. To be considered a match, the thing must find an object with all of the fields as the unblessed hash.

If that heuristic fails, as it would in the SYNOPSIS example where the <purple-new>> line is commented out, then a less nice strategy is attempted: all loaded packages are exampled for one containing the method called.

Why would anyone want this? You have a large legacy codebase that makes heavy use of hashes for collections of assortments of data and you want to shoehorn an OO-ish API onto it. Or perhaps you just want to play with an ultra lazy style of programming.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.0 or, at your option, any later version of Perl 5 you may have available.