In this way, you should be able to customise some aspects of the licensing messages that would otherwise be difficult to tinker, e.g. adding a note in the notice, setting multiple years for the copyright notice or set multiple authors and/or copyright holders.
The license details should be put inside a file that contains different sections. Each section has the following format:
Each section is terminated by the header of the following section or by the end of the file. Example:
__[ NAME ]__ The Foo-Bar License __URL__ http://www.example.com/foo-bar.txt __[ META_NAME ]__ foo_bar_meta __{ META2_NAME }__ foo_bar_meta2 __{ SPDX_EXPRESSION }__ foo_bar_spdx_expression __[ NOTICE ]__ Copyright (C) 2000-2002 by P.R. Evious Copyright (C) {{$self->year}} by {{$self->holder}}. This is free software, licensed under {{$self->name}}. __[ LICENSE ]__ The Foo-Bar License Well... this is only some sample text. Verily... only sample text!!! Yes, spanning more lines and more paragraphs.
The different formats for specifying the section name in the example above are only examples, you're invited to use a consistent approach.
my $slc = Software::License::Custom->new({filename => 'LEGAL'});
Create a new object. Arguments are passed through an anonymous hash, the following keys are allowed:
filename - the file where the custom software license details are stored
$slc->load_sections_from('MY-LEGAL-ASPECTS');
Loads the different sections of the license from the provided filename.
my $notice_template_reference = $slc->section_data('NOTICE');
Returns a reference to a textual template that can be fed to Text::Template (it could be simple text), according to what is currently loaded in the object.
For now, the "meta_name" and "meta2_name" methods return "custom" if called on the class. This may become fatal in the future.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.