1String::Copyright(3)  User Contributed Perl Documentation String::Copyright(3)
2
3
4

NAME

6       String::Copyright - Representation of text-based copyright statements
7

VERSION

9       Version 0.003008
10

SYNOPSIS

12           use String::Copyright;
13
14           my $copyright = copyright(<<'END');
15           copr. © 1999,2000 Foo Barbaz <fb@acme.corp> and Acme Corp.
16           Copyright (c) 2001,2004 Foo (work address) <foo@zorg.corp>
17           Copyright 2003, Foo B. and friends
18           © 2000, 2002 Foo Barbaz <foo@bar.baz>
19           END
20
21           print $copyright;
22
23           # Copyright 1999-2000 Foo Barbaz <fb@acme.com> and Acme Corp.
24           # Copyright 2000, 2002 Foo Barbaz and Acme Corp.
25           # Copyright 2001, 2004 Foo (work address) <foo@zorg.org>
26           # Copyright 2003 Foo B. and friends
27

DESCRIPTION

29       String::Copyright Parses common styles of copyright statements and
30       serializes in normalized format.
31

OPTIONS

33       Options can be set as an argument to the 'use' statement.
34
35   threshold, threshold_before, threshold_after
36           use String::Copyright { threshold_after => 5 };
37
38       Stop parsing after this many lines whithout copyright information,
39       before or after having found any copyright information at all.
40       "threshold" sets both "threshold_before" and "threshold_after".
41
42       By default unset: All lines are parsed.
43
44   format( \&sub )
45           use String::Copyright { format => \&GNU_style } };
46
47           sub GNU_style {
48               my ( $years, $owners ) = @_;
49
50               return 'Copyright (C) ' . join '  ', $years || '', $owners || '';
51           }
52

FUNCTIONS

54       Exports one function: "copyright".  This module uses Exporter::Tiny to
55       export functions, which allows for flexible import options; see the
56       Exporter::Tiny documentation for details.
57

SEE ALSO

59       •   Encode
60
61       •   Exporter::Tiny
62

BUGS/CAVEATS/etc

64       String::Copyright operates on strings, not bytes.  Data encoded as
65       UTF-8, Latin1 or other formats need to be decoded to strings before
66       use.
67
68       Only ASCII characters and © (copyright sign) are directly processed.
69
70       If copyright sign is mis-detected or accents or multi-byte characters
71       display wrong, then most likely the data was not decoded into a string.
72
73       If ranges or lists of years are not tidied, then maybe it contained
74       non-ASCII whitespace or digits.
75

AUTHOR

77       Jonas Smedegaard "<dr@jones.dk>"
78
80       Derived from App::Licensecheck originally part of the KDE SDK,
81       originally introduced by Stefan Westerfeld "<stefan@space.twc.de>"; and
82       on the script licensecheck2dep5 part of Debian CDBS tool, written by
83       Jonas Smedegaard.
84
85         Copyright © 2007, 2008 Adam D. Barratt
86
87         Copyright © 2005-2012, 2016 Jonas Smedegaard
88
89       This program is free software; you can redistribute it and/or modify it
90       under the terms of the GNU General Public License as published by the
91       Free Software Foundation; either version 3, or (at your option) any
92       later version.
93
94       This program is distributed in the hope that it will be useful, but
95       WITHOUT ANY WARRANTY; without even the implied warranty of
96       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
97       General Public License for more details.
98
99       You should have received a copy of the GNU General Public License along
100       with this program. If not, see <https://www.gnu.org/licenses/>.
101
102
103
104perl v5.34.0                      2021-08-19              String::Copyright(3)
Impressum