Pod::CopyrightYears - Object for copyright years changing in POD.
use Pod::CopyrightYears; my $obj = Pod::CopyrightYears->new(%params); $obj->change_years($last_year); my @pod_nodes = $obj->license_sections; my $pod = $obj->pod;
new
my $obj = Pod::CopyrightYears->new(%params);
Constructor.
debug
Debug mode.
Default value is 0.
pod_file
POD or Perl module file to process.
It's required parameter.
section_names
List of POD =head1 section names
=head1
Returns instance of object.
change_years
$obj->change_years($last_year);
Change year in text sections. Matches \d{4} or \d{4}-\d{4} strings.
\d{4}
\d{4}-\d{4}
Returns undef.
license_sections
my @pod_nodes = $obj->license_sections;
Get Pod::Abstract::Node nodes which match section_names parameter.
Returns list of nodes.
pod
my $pod = $obj->pod;
Serialize object to Perl module or POD output.
Returns string.
new(): From Class::Utils::set_params(): Unknown parameter '%s'. Parameter 'pod_file' is required.
use strict; use warnings; use File::Temp; use IO::Barf qw(barf); use Pod::CopyrightYears; my $content = <<'END'; package Example; 1; __END__ =pod =head1 LICENSE AND COPYRIGHT © 1977 Michal Josef Špaček =cut END # Temporary file. my $temp_file = File::Temp->new->filename; # Barf out. barf($temp_file, $content); # Object. my $obj = Pod::CopyrightYears->new( 'pod_file' => $temp_file, ); # Change years. $obj->change_years(1987); # Print out. print $obj->pod; # Unlink temporary file. unlink $temp_file; # Output: # package Example; # 1; # __END__ # =pod # # =head1 LICENSE AND COPYRIGHT # # © 1977-1987 Michal Josef Špaček # # =cut
Tool for update copyright years in Perl distribution.
Base class for perl-module-copyright-years tool.
Class::Utils, Error::Pure, Pod::Abstract.
https://github.com/michal-josef-spacek/Pod-CopyrightYears
Michal Josef Špaček mailto:skim@cpan.org
http://skim.cz
© 2023 Michal Josef Špaček
BSD 2-Clause License
0.03
To install Pod::CopyrightYears, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pod::CopyrightYears
CPAN shell
perl -MCPAN -e shell install Pod::CopyrightYears
For more information on module installation, please visit the detailed CPAN module installation guide.