The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Software::Copyright::Owner - Copyright owner class

VERSION

version 0.008

SYNOPSIS

 use Software::Copyright::Owner;

 # one owner
 my $owner = Software::Copyright::Owner->new('Joe <joe@example.com>');

 $owner->name; # => is "Joe"
 $owner->email; # => is 'joe@example.com'
 $owner->identifier; # => is 'Joe'

 # stringification
 my $s = "$owner"; # => is 'Joe <joe@example.com>'

 # several owners, separated by "and" or ","
 my $owner2 = Software::Copyright::Owner->new('Joe <joe@example.com>, William, Jack and Averell');

 $owner2->name; # => is undef
 $owner2->email; # => is undef
 $owner2->record; # => is 'Joe <joe@example.com>, William, Jack and Averell'
 $owner2->identifier; # => is 'Joe <joe@example.com>, William, Jack and Averell'

 # stringification
 $s = "$owner2"; # => is 'Joe <joe@example.com>, William, Jack and Averell'

DESCRIPTION

This class holds the name and email of a copyright holder.

CONSTRUCTOR

The constructor can be called without argument or with a string containing a name and an optional email address. E.g:

 my $owner = Software::Copyright::Owner->new();
 my $owner = Software::Copyright::Owner->new('Joe');
 my $owner = Software::Copyright::Owner->new('Joe <joe@example.com>');

It can also be called with copyright assignment involving more than one person. See synopsis for details.

Methods

name

Set or get owner's name. Note that names with Unicode characters are normalized to Canonical Composition (NFC). Name can be empty when the copyright owners has more that one name (i.e. John Doe and Jane Doe.

record

Set or get the record of a copyright. The record is set by constructor when the owner contains more than one name.

identifier

Returns name or record.

email

Set or get owner's email

stringify

Returns a string containing name (or record) and email (if any) of the copyright owner.

Operator overload

Operator "" is overloaded to call stringify.

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