I am working on some Perl classes that are auto-generated from http://schema.org class definitions, and can then be used to output json-ld metadata appropriate to the classes (e.g. for embedding in a web page to help search engines index the content).
Eventually I hope to add classes for other data schemes (e.g. "dc", "foaf" etc.) and allow them to be combined.
In the mean time, I am unsure what to call the module. I chose the "LDF::" namespace since it relates to linked data fragments, but I'm not happy with that. I am open to suggestions.
I've been thinking that it would be nice when using DBIx::Class to be able to define columns using Type::Tiny-style types, e.g.
column foo => ( isa => Maybe[Varchar] );
and have something that extracts the column info from the type.
Whether this should be a change to DBIC or a plugin/extension, I'm not yet sure. But the first thing is to create a type library and a utility function to extract the column_info from the type.
Part of the idea is that you can declare your own types that inherit from these types, and it should still work.
I have some legacy modules that allow non-OO usage, e.g. you can just call methods as functions. If the first argument isn't a blessed reference to the class, then it uses a default singleton instance.
I'd like to convert the modules to use Moo, and have realized the code can be generalized to a module.
(Yes, I know a lot of people frown on this. I do now, but I'd like to maintain backward compatibility. And arguably OO, while making this module simpler to write, is overkill for some use cases.)
I have a working prototype.
My big question is: 1. Is there already something that does this for Moo (so I don't waste timing writing another module)? 2. Is there a better name for this?
Basically, this makes it easier to define exportable constants to be shared in your code.
Edit: I've looked at similar modules, and they don't do what I'm looking for (which is mainly to export a variety of types as constants, including interpolated readonly values, organised into tags).
A prototype is on GitHub
This would be largely the same as Object::Signature, except that it will use "canonical" JSON (or perhaps YAML) instead of Storable for serializing the object.
The reason behind this is that Storable does not generate the same format file across different versions of that module on different platforms with different Perl versions. In cases where one needs a "signature" for an object to be shared across multiple platforms, this is a cleaner method for generating signatures.
I am thinking of a way to make the backend (JSON, YAML, or Data::Dumper) an option as well as the signature method (MD5, SHA1, etc.).
This would be similar to Catalyst::Controller::RequestToken, but that module requires different controller methods for displaying the form and processing the response.
Instead, this module would extend HTML::FormHandler with a lazy attribute that contains a random token. A new field type "RequestToken" would check against the request token.
To use, one need only provide the token to the displayed form, and add a field for the request token type.
The aim of this module is to provide a common API for rules to rewrite Perl scripts. Sample rules might be:
ensure every script has a shebang line
ensure every script and module specifies a minimum Perl version
change occurrances of die/warn to croak/carp, and ensure the Carp module is used
change print "...\n" to say "...", and ensure v5.10.1 minimum Perl version is used
change complex if/else blocks to for/when blocks
change include lines (use/require/etc) so that they are sorted, e.g. perl version, then pragmas (sorted), and then modules (sorted)
The intention of this module is to assist with updating large legacy codebases, or as a companion to Perl::Tidy and Perl::Critic that can enforce coding policies.