String::Copyright(3pm)

String::Copyright3pm

Representation of text-based copyright statements

Usage

    use String::Copyright;
    my $copyright = copyright(<<'END');
    copr. © 1999,2000 Foo Barbaz <[email protected]> and Acme Corp.
    Copyright (c) 2001,2004 Foo (work address) <[email protected]>
    Copyright 2003, Foo B. and friends
    © 2000, 2002 Foo Barbaz <[email protected]>
    END
    print $copyright;
    # Copyright 1999-2000 Foo Barbaz <[email protected]> and Acme Corp.
    # Copyright 2000, 2002 Foo Barbaz and Acme Corp.
    # Copyright 2001, 2004 Foo (work address) <[email protected]>
    # Copyright 2003 Foo B. and friends

Version

Version 0.003014

Overview

String::Copyright identifies copyright statements in a string and serializes them in a normalized format.

Options

Options can be set as an argument to the 'use' statement.

threshold, threshold_before, threshold_after

    use String::Copyright { threshold_after => 5 };

Stop parsing after this many lines without copyright information, before or after having found any copyright information at all. "threshold" sets both "threshold_before" and "threshold_after".

By default unset: All lines are parsed.

format( \&sub )

    use String::Copyright { format => \&GNU_style } };
    sub GNU_style {
        my ( $years, $owners ) = @_;
        return 'Copyright (C) ' . join '  ', $years || '', $owners || '';
    }

Functions

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

BUGS/CAVEATS/etc

String::Copyright operates on strings, not bytes. Data encoded as UTF-8, Latin1 or other formats need to be decoded to strings before use.

Only ASCII characters and © (copyright sign) are directly processed.

If copyright sign is not detected or accents or multi-byte characters display wrong, then most likely the data was not decoded into a string.

If ranges or lists of years are not tidied, then maybe it contained non-ASCII whitespace or digits.

Releases

5 releases since Debian 9 (Stretch); the text changed 2 times.

  1. 9
  2. 10–11
  3. 12–13

Author

Jonas Smedegaard "<[email protected]>"

From libstring-copyright-perl 0.003014-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.