Softwa...tement(3pm)

πŸ“¦
version 0.015 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

okay bestie, so this is Software::Copyright::Statement, a Perl module (manual section 3pm, user contributed perl docs, iykyk) and it is literally the single most put-together little class you'll ever meet. One owner, one statement: years, name, email. That's it. That's the whole vibe. πŸŽ€

VERSION: version 0.015 β€” yes queen, tiny version number, massive energy. πŸ‘‘


✨ SYNOPSIS ✨

use Software::Copyright::Statement;

my $statement = Software::Copyright::Statement->new('2020,2021, Joe <joe@example.com>');

$statement->name; # => is "Joe"
$statement->email; # => is 'joe@example.com'
$statement->range; # => is '2020, 2021'

# merge records
$statement->merge(Software::Copyright::Statement->new('2022, Joe <joe@example.com>'));
$statement->range; # => is '2020-2022'

# update the year range
$statement->add_years('2015, 2016-2019')->stringify; # => is '2015-2022, Joe <joe@example.com>'

# stringification
my $string = "$statement"; # => is '2015-2022, Joe <joe@example.com>'

# test if a statement "contains" another one
my $st_2020 = Software::Copyright::Statement->new('2020, Joe <joe@example.com>');
$statement->contains($st_2020); # => is '1'

like. look at it. it ate. πŸ’…


🌸 DESCRIPTION 🌸

This class holds one copyright statement, which is to say: the year range, the name, and the email of exactly one copyright contributor. One owner, one statement, no chaos, no drama. πŸ¦‹

And here's the cute part β€” when you construct one of these, it does a lil cleanup pass so your statement comes out more standard. It's giving "let me fix your formatting, bestie." Some cleanup examples, fr fr:

2002-6 Joe => 2002-2006, Joe
2001,2002,2003,2004 Joe => 2001-2004, Joe
# found in markdown documents
2002 Joe mailto:joe@example.com => 2002, Joe <joe@example.com>

πŸŽ€ CONSTRUCTOR πŸŽ€

You can call the constructor with no argument at all, or with a string containing:

  • a year range (this one's optional, she's flexible)
  • a name (mandatory β€” no name, no statement, periodt)
  • an email address (optional, but like… include it, it's cute)

E.g:

my $st = Software::Copyright::Statement->new();
my $st = Software::Copyright::Statement->new('2002, Joe <joe@example.com>');

Methods πŸ’«

name

Set or get owner's name. Simple. Iconic.

email

Set or get owner's name.

not me double-checking this one β€” yes, the original really does say "owner's name" here too, even though it's the email method. keeping it exactly as written because the facts stay, always. πŸ˜­πŸ’€

owner

Returns a Software::Copyright::Owner object. And the tea is: this object can be used as a string. 🫢

merge

Merge 2 statements. Heads up though β€” the 2 statements must belong to the same owner (meaning the name attributes have to be identical, no negotiating).

See the Synopsis for an example, bestie.

This method returns $self. πŸ”

add_years

Add a year range to the copyright owner. This method accepts year ranges like "2020", "2018, 2020", "2016-2020,2022". White spaces are ignored β€” she does not see them, she does not care about them. ✨

This method returns $self. πŸ”

stringify

Returns a string containing a year range (if any), a name and email (if any) of the copyright owner. Basically the whole glow-up in string form. 🌈

contains

Return 1 if the other statement is contained in the current statement β€” i.e. owner or record are identical, and the other year range is contained in the current year range.

For instance:

  • "2016, Joe" is contained in "2014-2020, Joe" βœ…
  • "2010, Joe" is not contained in "2014-2020, Joe" ❌

Operator overload

Operator "" is overloaded to call "stringify". So when you interpolate her, she just… stringifies. Main character behavior, honestly. πŸ‘‘


πŸ’œ AUTHOR πŸ’œ

Dominique Dumont


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

and that's the whole page, bestie 🫢 this was perl v5.40.1, dated 2025-04-07, from the Softwa...tement(3pm) page β€” go forth and copyright responsibly, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from