NAME
Software::Copyright - Copyright class
VERSION
version 0.001
SYNOPSIS
use Software::Copyright;
my $copyright = Software::Copyright->new('2020,2021, Joe <joe@example.com>');
# stringification
my $s = "$copyright"; # => is "2020, 2021, Joe <joe\@example.com>"
# add with merge
$copyright->merge('2018-2020 Averell');
# after addition
$s = "$copyright"; # => is "2020, 2021, Joe <joe\@example.com>\n2018-2020, Averell"
# merge statement which adds email
$copyright->merge('2016, Averell <averell@example.com>');
$s = "$copyright"; # => is "2020, 2021, Joe <joe\@example.com>\n2016, 2018-2020, Averell <averell\@example.com>"
DESCRIPTION
This class holds a copyright statement, i.e. a set of year range, name and email.
CONSTRUCTOR
The constructor is called with a copyright statement string. This string can be spread on several lines. The constructor is also compatible with the string given by Debian's licensecheck, i.e. the statements can be separated by "/
".
Methods
statement_by_name
Get the Software::Copyright::Statement object of a given user.
statement_list
Returns a list of Software::Copyright::Statement object for all users.
stringify
Returns a string containing a cleaned up copyright statement.
is_valid
Returns true if the copyright contains valid records, i.e. records with names.
owners
Return a list of statement owners. An owner is either a name or a record.
statement
Returns the Software::Copyright::Statement object for the given owner:
my $statement = $copyright->statement('Joe Dalton');
merge
Merge in a statement. This statement is either merged with a existing statement when the owner match or appended to the list of statements.
The statement parameter can either be a string or an Software::Copyright::Statement object.
Operator overload
Operator ""
, eq
and ne
are overloaded.
See also
Software::Copyright::Statement, Software::Copyright::Owner
AUTHOR
Dominique Dumont
COPYRIGHT AND LICENSE
This software is Copyright (c) 2022 by Dominique Dumont <dod@debian.org>.
This is free software, licensed under:
The GNU General Public License, Version 3, June 2007