<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    License::SPDX - Object for SPDX licenses handling.

SYNOPSIS
     use License::SPDX;

     my $obj = License::SPDX-&gt;new;
     my $checked = $obj-&gt;check_license($check_string, $opts_hr);
     my $license_hr = $obj-&gt;license($license_id);
     my $licenses = $obj-&gt;licenses;
     my $spdx_release_date = $obj-&gt;spdx_release_date;
     my $spdx_version = $obj-&gt;spdx_version;

METHODS
  "new"
     my $obj = License::SPDX-&gt;new;

    Constructor.

    Returns instance of object.

  "check_license"
     my $checked = $obj-&gt;check_license($check_string, $opts_hr);

    Check if license exists. Argument $opts_hr is reference to hash with
    parameter 'check_type' for definition of "check_license()" type.

    Possible 'check_type' values:

     'id' - Check license id.
     'name' - Check license name.

    Default value of 'check_type' is 'id'. If 'check_type' is bad, fail with
    error.

    Returns 1 (license exist) or 0 (license doesn't exist).

  "license"
     my $license_hr = $obj-&gt;license($license_id);

    Get license structure.

    Returns reference to hash.

  "licenses"
     my $licenses = $obj-&gt;licenses;

    Get all license structures.

    Returns array of references to hash.

  "spdx_release_date"
     my $spdx_release_date = $obj-&gt;spdx_release_date;

    Get release date of data structure with SPDX license.

    Returns string.

  "spdx_version"
     my $spdx_version = $obj-&gt;spdx_version;

    Get version of data structure with SPDX license.

    Returns string.

ERRORS
     new():
             From Class::Utils::set_params():
                     Unknown parameter '%s'.

     check_license():
             Check type '%s' doesn't supported.

EXAMPLE
     use strict;
     use warnings;

     use License::SPDX;

     if (@ARGV &lt; 1) {
             print STDERR "Usage: $0 license_id\n";
             exit 1;
     }
     my $license_id = $ARGV[0];

     # Object.
     my $obj = License::SPDX-&gt;new;

     print 'License with id \''.$license_id.'\' is ';
     if ($obj-&gt;check_license($license_id)) {
             print "suppored.\n";
     } else {
             print "not suppored.\n";
     }

     # Output for 'MIT':
     # License with id 'MIT' is suppored.

     # Output for 'BAD':
     # License with id 'BAD' is not suppored.

DEPENDENCIES
    Class::Utils, Cpanel::JSON::XS, Error::Pure. File::Share, List::Util,
    Perl6::Slurp.

SEE ALSO
    rpm-spec-license
        Tool for working with RPM spec file licenses.

REPOSITORY
    &lt;https://github.com/michal-josef-spacek/License-SPDX&gt;

AUTHOR
    Michal Josef Ĺ&nbsp;paÄŤek &lt;mailto:skim@cpan.org&gt;

    &lt;http://skim.cz&gt;

LICENSE AND COPYRIGHT
    Â© 2023 Michal Josef Ĺ&nbsp;paÄŤek

    BSD 2-Clause License

VERSION
    0.02

</pre></body></html>