1App::Licensecheck(3) User Contributed Perl Documentation App::Licensecheck(3)
2
3
4
6 App::Licensecheck - functions for a simple license checker for source
7 files
8
10 Version v3.3.9
11
13 use Path::Tiny;
14 use App::Licensecheck;
15
16 my $tempfile = Path::Tiny->tempfile;
17
18 $tempfile->spew(<<EOF);
19 # Dummy file simply stating some copyright and license.
20 # Copyright (C) 2020, 2022 Foo Bar.
21 #
22 # This file is licensed under version 2 or later of the GPL.
23 EOF
24
25 my $app = App::Licensecheck->new( top_lines => 0 ); # Parse whole files
26
27 my @output = $app->parse($tempfile);
28
29 my $license = $output[0]; # => is "GPL-2.0-or-later"
30 my $copyrights = $output[1]; # => is "2020, 2022 Foo Bar."
31
33 App::Licensecheck is the core of licensecheck script to check for
34 licenses of source files. See the script for casual usage.
35
37 Jonas Smedegaard "<dr@jones.dk>"
38
40 This program is based on the script "licensecheck" from the KDE SDK,
41 originally introduced by Stefan Westerfeld "<stefan@space.twc.de>".
42
43 Copyright © 2007, 2008 Adam D. Barratt
44
45 Copyright © 2012 Francesco Poli
46
47 Copyright © 2016-2022 Jonas Smedegaard
48
49 Copyright © 2017-2022 Purism SPC
50
51 This program is free software: you can redistribute it and/or modify it
52 under the terms of the GNU Affero General Public License as published
53 by the Free Software Foundation, either version 3, or (at your option)
54 any later version.
55
56 This program is distributed in the hope that it will be useful, but
57 WITHOUT ANY WARRANTY; without even the implied warranty of
58 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
59 Affero General Public License for more details.
60
61 You should have received a copy of the GNU Affero General Public
62 License along with this program. If not, see
63 <https://www.gnu.org/licenses/>.
64
65
66
67perl v5.38.0 2023-07-20 App::Licensecheck(3)