String...pyright(3pm)
π String::Copyright π
okay bestie, welcome to String::Copyright β it's a Perl module (a 3pm one, so you know it's the docs kind) that deals with text-based copyright statements. yes, the boring legal lines. except now they're our problem and we're gonna make them cute. β¨
π NAME π
String::Copyright β representation of text-based copyright statements. that's it, that's the whole vibe. π
πΈ VERSION πΈ
Version 0.003014 π¦
β¨ SYNOPSIS β¨
here's how you actually use it, bestie:
use String::Copyright;
my $copyright = copyright(<<'END');
copr. Β© 1999,2000 Foo Barbaz <fb@acme.corp> and Acme Corp.
Copyright (c) 2001,2004 Foo (work address) <foo@zorg.corp>
Copyright 2003, Foo B. and friends
Β© 2000, 2002 Foo Barbaz <foo@bar.baz>
END
print $copyright;
# Copyright 1999-2000 Foo Barbaz <fb@acme.com> and Acme Corp.
# Copyright 2000, 2002 Foo Barbaz and Acme Corp.
# Copyright 2001, 2004 Foo (work address) <foo@zorg.org>
# Copyright 2003 Foo B. and friends
likeβ¦ look at that glow-up. messy input in, normalized output out. it ate. π
π DESCRIPTION π
String::Copyright finds copyright statements hiding in a string and then serializes them into a normalized format. it's giving detective but for legal text. πβ¨
π OPTIONS π
you can set these by passing them as an argument to the use statement. slay.
β threshold, threshold_before, threshold_after
use String::Copyright { threshold_after => 5 };
okay so this one is about when to stop parsing. it stops after this many lines without copyright info β either before you've found any copyright info at all, or after you've already found some. threshold is the two-for-one deal: it sets both threshold_before and threshold_after at the same time. π«Ά
by default it's unset, which means all lines get parsed. no cap. every single one.
β format( &sub )
use String::Copyright { format => \&GNU_style } };
sub GNU_style {
my ( $years, $owners ) = @_;
return 'Copyright (C) ' . join ' ', $years || '', $owners || '';
}
you hand it a coderef and it lets you customize the output format. your sub gets the years and the owners, and you return whatever gorgeous string you want. main character formatting energy. π
π¦ FUNCTIONS π¦
this module exports exactly one function: copyright. πΈ
it uses Exporter::Tiny to do the exporting, which means you get flexible import options β go read the Exporter::Tiny docs for the details, iykyk.
π«Ά SEE ALSO π«Ά
- Encode
- Exporter::Tiny
π BUGS/CAVEATS/etc π
okay this is the part where we get real. π«
- String::Copyright operates on strings, not bytes. data encoded as
UTF-8,Latin1or other formats needs to be decoded to strings before use. do not skip this step bestie i am begging. - only ASCII characters and
Β©(the copyright sign) are directly processed. - if the copyright sign isn't detected, or accents / multi-byte characters display wrong, then most likely the data was not decoded into a string. that's the tea. π΅
- if ranges or lists of years aren't tidied, then maybe it contained non-ASCII whitespace or digits. yeah. sneaky ones.
π AUTHOR π
Jonas Smedegaard <dr@jones.dk> π
π COPYRIGHT AND LICENSE π
this program is based on the script licensecheck from the KDE SDK, originally introduced by Stefan Westerfeld <stefan@space.twc.de>. iconic lineage fr fr.
Copyright Β© 2007, 2008 Adam D. Barratt
Copyright Β© 2005-2012, 2016, 2018, 2020-2021 Jonas Smedegaard
Copyright Β© 2018, 2020-2021 Purism SPC
this program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. π
this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU Affero General Public License for more details.
you should have received a copy of the GNU Affero General Public License along with this program. if not, see <https://www.gnu.org/licenses/>. π«Ά
and that's the whole page, bestie!! β¨ this lil doc drop came from perl v5.36.0, dated 2022-12-17, and lives under the manual name String...pyright(3pm). go forth and normalize those copyrights, you absolute legend. π
ππ¦
π¦ where this page comes from
- debian bookworm: libstring-copyright-perl 0.003014-1 Β· AGPL-3.0-or-later
- debian trixie: libstring-copyright-perl 0.003014-1 Β· AGPL-3.0-or-later
- ubuntu noble: libstring-copyright-perl 0.003014-1 Β· AGPL-3.0-or-later
- ubuntu resolute: libstring-copyright-perl 0.003014-1 Β· AGPL-3.0-or-later
- ubuntu stonking: libstring-copyright-perl 0.003014-1 Β· AGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms