Share
Embed
Annual Pro sale · Save $30
Have presentations of your own?
Share with private links, password protection, and more control over your work.
Transcript
89 slides
-
me 2016年のPerl@LLoT Perl in 2016@YAPC::Hokkaido 2017年春のPerl@YAPC::Kansai 2017年夏のPerl@YAPC::Fukuoka (萬國之津梁@YAPC::Okinawa) (2018年初夏のPerl5)@Hokkaido.pm #14
2018年夏のPerl5@Shibuya.pm #18 2018年残暑のPerl@LL2018 2019年冬のPerl@YAPC::Tokyo (Learn Languages 2021) 2023年春のPerl@YAPC::Kyoto 2024年冬のPerl@YAPC::Hiroshima 2024年秋のPerl@YAPC::Hakodate 2025年秋のPerl@YAPC::Fukuoka 2026年秋のPerl@YAPC::Tokyo <- イマココ -
2016: Perl 5.24 • • • • • First major
Perl 5 release after Perl 6.c postderef (5.20-) is no longer experimental autoderef (5.14-) is gone lexical $_ (5.10-) is gone current minimum supported Perl for toolchain -
2016: Perl 5.24 postfix dereference push $arrayref->@*, $scalar; push $blessed_arrayref->@*,
$scalar; print "interpolates $arrayref->@*"; △ $undef->%* # warning × $maybe_undef->%* // {} ◦ ($maybe_undef // {})->%* × keys ($maybe_hashref // {})->%* ◦ keys (($maybe_hashref // {})->%*) ◦ keys %{$maybe_hashref // {}} # shorter... -
2017: Perl 5.26 • • • • • • •
No dot in @INC new pumpking new perldeprecation.pod unescaped { in regexp ${^ENCODING} was removed lexical subroutines are no longer experimental indented here doc (<<~EOT) -
2017: Perl 5.26 No dot in @INC broke things like
• • • • inc::Module::Install t::Util do "localfile.pl"; require "localfile.pl"; CPAN clients still set PERL_USE_UNSAFE_INC... -
2017: Perl 5.26 unescaped { in regexp $foo =~ /$hash{bar}/;
$foo =~ /$hashlike{}/; $foo =~ /${¥$foo}/; $foo =~ /${¥${foo}}/; $foo =~ /¥$foo/; $foo =~ /¥${foo}/; $foo =~ /¥${[^¥}]*}/; # ok # error since 5.26 # ok (deref) # ok (deref) # ok # error since 5.26 # autoconf issue -
2018: Perl 5.28 • • • • • • lots
of removals and deprecations subroutine attribute/signature reordered string bitwise ops are stable delete %hash{@list} search.cpan.org shutdown (1999-2018/06) Perl 6.d was released (2018/11) -
2018: Perl 5.28 subroutine attribute/signature reordered sub f :lvalue ($a,
$b) { ... }; # 5.20 sub f ($a, $b) :lvalue { ... }; # 5.22-26 sub f :lvalue ($a, $b) { ... }; # 5.28App::sigfix to transform files between signature syntax versions -
2019: Perl 5.30 • Perl 6 was renamed as Raku
(2019/10) • now fatal: • sysread/syswrite on :utf8 handles • my $x if 0 • and more, as planned • transition to GitHub (2019/10) • Future::AwaitAsync on a TPF grant (-2019/10) • Cor (core Perl OO) project started (2019/10) -
2020: Perl 5.32 • • • • • • COVID-19
pandemic (2019/12-2023/05) Perl 7 announcement Perl Steering Council (2020/12) experimental isa op $min < $x < $max no feature ’indirect’ -
2020: Perl 5.32 The right way to use "isa" in
UNIVERSAL use Scalar::Util qw(blessed); if (blessed $thing and $thing->isa('Foo::Bar')) { ... } -
2020: Perl 5.32 isa operator use v5.32; use experimental qw(isa);
if ($thing isa Foo::Bar) { ... } -
2021: Perl 5.34 • • • • • perlgov.pod Perl
Proposed Changes started experimental try/catch octal literal prefix (0o) multidimentional/bareword_filehandles -
2021: Perl 5.34 Try::Tiny requires ';' at the end use
Try::Tiny; try { die "foo"; } catch { warn "caught error: $_"; # not $@ }; -
2021: Perl 5.34 Syntax::Keyword::Try (2016-) use Syntax::Keyword::Try; try { die
"foo"; } catch { warn "caught error: $@"; } -
2021: Perl 5.34 experimental try use v5.34; use experimental 'try’;
try { die "foo"; } catch ($e) { warn "caught error: $e"; } -
2022: Perl 5.36 • subroutine signatures are finally stable •
use v5.36 bundle • experimental finally • experimental defer • experimental builtin • experimental for_list -
2022: Perl 5.36 use v5.36; • • • • •
• • strict (5.12-) warnings signatures isa (no) indirect (no) multidimensional (no) switch -
2022: Perl 5.36 experimental builtin use v5.36; use experimental 'builtin';
use builtin qw(true false); -
2022: Perl 5.36 experimental for_list use v5.36; use experimental 'for_list’;
for my ($key, $value) (%hash) { ... } -
2022: Perl 5.36 experimental builtin/for_list use v5.36; use experimental qw(builtin
for_list); use builtin qw(indexed); for my ($i, $value) (indexed @array) { ... } -
2023: Perl 5.38 • • • • • • experimental
class feature module_true builtin::export_lexically defined-or default in signatures Lyon Amendment (on minimum-support Perl) CPAN Security Working Group (2023/04) -
2023: Perl 5.38 class feature introduces a few new keywords
use v5.38; use experimental 'class’; class CPANAuthor :isa(Person) { field $pause_id :param; method name_and_id () { return $self->name . " ($pause_id)"; } method upload ($distribution) { ... } } -
2023: Perl 5.38 defined-or default in signatures use v5.38; sub
point ($x, $y //= 10) { say "($x, $y)"; } -
2023: Perl 5.38 module_true package Foo; use v5.38; # or
use feature qw(module_true); sub foo { ... } # you don't need a true value here anymore -
Minimum supported Perl versions As of 2026 • • •
• • • 5.44 (stable) 5.42 (bug fixes) 5.40 (security fixes only) 5.24 (toolchain) 5.22 (docker-perl) 5.8-buster (old docker-perl) -
Minimum supported Perl versions • • • • • •
• App::cpm (5.24) Object::Pad (5.22) Dist::Zilla (5.20) Mojolicious (5.16) Dancer2 (5.14) Plack (5.12; IO::Socket::IP requires 5.14) DBI (5.12; next release requires 5.14) -
Minimum supported Perl versions Perl Distro EOL 5.40 Ubuntu 26
2031/05 (2036/2041) RHEL 10 2030/05 (2035) Debian 13 2028/08 (2030/2035) 5.38 Ubuntu 24 2029/05 (2034/2036) 5.36 Debian 12 2026/06 (2028/2033) 5.34 Ubuntu 22 2027/04 (2032/2034) 5.32 Amazon Linux 2023 2027/06 (2029) RHEL 9 2027/05 (2032/2035) Debian 11 2024/08 (2026/2031) 5.30 Ubuntu 20 2025/05 (2030/2032) 5.26 RHEL 8 2024/05 (2029/2032) 5.16 Amazon Linux 2 2026/06 CentOS 7 2024/06 -
2024: Perl 5.40 • • • • • lots of
features are now stable builtin::load_module :reader class attribute Test2::Suite is in core PPC 25: Perl 5 is Perl -
2024: Perl 5.40 builtin::load_module (PPC0006) use experimental qw(builtin); use builtin
qw(load_module); ◦ my $foobar = load_module('Foo::Bar')->new; × load_module('Foo::Bar', '1.00')->new; ◦ load_module('Foo::Bar')->VERSION('1.00'); -
2024: Perl 5.40 builtin::load_module vs require use experimental qw(builtin); use
builtin qw(load_module); ◦ require v5.40; ◦ require CGI; ◦ require './do.pl'; × load_module(v5.40); × load_module(CGI); × load_module('./do.pl'); -
2025: Perl 5.42 • • • • • experimental any/all
keywords :writer class attribute my method and ->& source::encoding no longer deprecated • not in version bundles • smartmatch • switch • apostrophe_as_package_separator -
2025: Perl 5.42 use v5.42; • • • • •
• • • • strict (5.12-) warnings (5.36-) signatures (5.36-) try (5.40-) (no) bareword_filehandles (5.38-) (no) switch (5.36-) (no) smartmatch (no) apostrophe_as_package_separator source::encoding 'ascii'; -
2025: Perl 5.42 source::encoding (without use utf8) use v5.42; say
'あああ'; use v5.42; # NG #ASCII only # あああ # NG __END__ =pod =pod NAME - あああ =cut # NG NAME - あああ =cut # OK -
2025: Perl 5.42 private method use v5.42; use experimental 'class';
class Foo { my method error_check { ... } method do_something { $self->&error_check(@_); } } -
2025: Perl 5.42 ->& and lexical sub use v5.42; my
sub error_check { ... } sub do_something { my $self = shift; ... $self->&error_check(@_); } -
2026: Perl 5.44 • • • • • • •
release delayed (Jul 15) experimental named subroutine signatures multi-variable foreach and ref alias experimental enhanced_xx PRNG seeding via getentropy() goto to jump into a loop/block now fatal Time::HiRes::sleep prototype change -
Named subroutine signatures Normal (positional) subroutine signatures use v5.36; sub
foo ($x, $y) { ... } foo(1, 2); # $x = 1, $y = 2 -
Named subroutine signatures Positional parameters may have default values. use
v5.36; sub foo ($x = 0, $y = 0) { ... } foo(1, 2); # $x = 1, $y = 2 foo(); # $x = 0, $y = 0 foo(undef, undef); # $x = undef, $y = undef -
Named subroutine signatures defined-or default values (since 5.38) use v5.38;
sub foo ($x //= 0, $y //= 0) { ... } foo(1, 2); # $x = 1, $y = 2 foo(); # $x = 0, $y = 0 foo(undef, undef); # $x = 0, $y = 0 -
Named subroutine signatures Optional positional parameters must come after all
mandatory parameters use v5.36; ×sub foo ($x = 0, $y = 0, $z) { ... } -
Named subroutine signatures Except a “slurpy” parameter use v5.36; sub
foo ($x = 0, $y = 0, @z) { ... } foo(1, 2, 3, ...); -
Named subroutine signatures Slurpy parameter may be a hash use
v5.36; sub foo ($x = 0, $y = 0, %z) { ... } foo(1, 2, a => 3, b => 4, ...); -
Named subroutine signatures Slurp everything? use v5.36; sub foo (%p)
{ ... } foo(x => 1, y => 2, ...); # $p{x} = 1, $p{y} = 2 -
Named subroutine signatures Named subroutine signatures use v5.44; use experimental
'signature_named_parameters’; sub foo (:$x, :$y) { ... } foo(x => 1, y => 2); # $x = 1, $y = 2 -
Named subroutine signatures With default values use v5.44; use experimental
'signature_named_parameters’; sub foo (:$x = 0, :$y = 0) { ... } foo(x => 1, y => 2); # $x = 1, $y = 2 foo(); # $x = 0, $y = 0 foo(x => undef, y => undef); # $x = undef, $y = undef -
Named subroutine signatures With defined-or default values use v5.44; use
experimental 'signature_named_parameters’; sub foo (:$x //= 0, :$y //= 0) { ... } foo(x => 1, y => 2); # $x = 1, $y = 2 foo(); # $x = 0, $y = 0 foo(x => undef, y => undef); # $x = 0, $y = 0 -
Named subroutine signatures With positional parameters use v5.44; use experimental
'signature_named_parameters’; sub foo ($host, $port, :$x //= 0, :$y //= 0) { ... } foo('host', 'port', x => 1, y => 2); # $host = 'host', $port = 'port', $x = 1, $y = 2 -
Named subroutine signatures Positional parameters can't follow named parameters use
v5.44; use experimental 'signature_named_parameters’; ×sub foo (:$x //= 0, :$y //= 0, $z) { ... } -
Named subroutine signatures Except an optional slurpy parameter use v5.44;
use experimental 'signature_named_parameters’; sub foo (:$x //= 0, :$y //= 0, @z) { ... } foo(x => 1, y => 2, ...); # $x = 1, $y = 2, @z = ... foo(a => -1, x => 1, y => 2, ...); # $x = 1, $y = 2, @z = (a => -1, ...) ×foo("a", x => 1, y => 2, ...); # $x = 0, $y = 0, @z = (a => "x", 1 => "y", 2 => ...) -
Named subroutine signatures No named slurpy parameter use v5.44; use
experimental 'signature_named_parameters’; ×sub foo (:$x //= 0, :$y //= 0, :%z) { ... } # A named signature parameter must start with '$' -
Multi-variable foreach and refalias Traditional way my @array_of_hashrefs = (
{ id => 'ISHIGAKI', ... }, ... ); for my $hashref (@array_of_hashrefs) { say $hashref->{id}; ... } -
Multi-variable foreach and refalias With refalias introduced in Perl 5.22
use v5.22; use experimental 'refaliasing’; my %hash; for ¥%hash (@array_of_hashrefs) { say $hash{id}; ... } -
Multi-variable foreach and refalias With declared_refs introduced in Perl 5.26
use v5.26; use experimental 'refaliasing'; use experimental 'declared_refs’; for my ¥%hash (@array_of_hashrefs) { say $hash{id}; ... } -
Multi-variable foreach and refalias With multi-variable foreach introduced in Perl
5.36 use v5.36; use experimental 'for_list’; for my ($key, $value) (%hash) { ... } -
Multi-variable foreach and refalias Now you can use them together.
(for_list is no longer experimental) use v5.44; use experimental 'refaliasing'; use experimental 'declared_refs’; my %hash_of_hashrefs = ( ISHIGAKI => { name => 'value', ... }, ... ); for my ($id, ¥%hash) (%hash_of_hashrefs) { say "$id: $hash{name}"; ... } -
Multi-variable foreach and refalias This doesn’t work as expected, though...
use v5.44; use experimental 'refaliasing'; use experimental 'declared_refs’; my @array_of_hashrefs = ( { name => 'value', ... }, ... ); for my ($i, ¥%hash) (indexed @array_of_hashrefs) { ×say "$i: $hash{name}"; ... } -
experimental enhanced_xx Traditional /x $program =~ s{ /¥* # Match
the opening delimiter. .*? # Match a minimal number of characters. ¥*/ # Match the closing delimiter. }{}gsx; -
experimental enhanced_xx /xx, introduced in 5.26, allows whitespace inside []
use v5.26; / [d-e g-i 3-7]/xx /[ ! @ " # $ % ^ & * () = ? <> ' ]/xx -
experimental enhanced_xx enhanced_xx allows comments in [] use v5.44; use
experimental 'enhanced_xx’; # URI characters /[ A-Za-z0-9 ¥-._~ !$&'()*+,;= :@ ]/xx; # unreserved # sub-delims # also allowed in a path segment -
experimental enhanced_xx Now you need to escape # use v5.44;
use experimental 'enhanced_xx’; / [ a-z ¥#0-9 ] /xx; # needs escape / [ a-z #0-9 ] /xx; # warns -
PRNG seeding via getentropy() • no need to change your
code • Still, rand() is not cryptographically secure -
goto to jump into a loop/block use v5.44; goto INSIDE;
# now fatal for my $i (1..3) { INSIDE: say $i; } -
goto to jump into a loop/block Also fatal use v5.44;
goto INSIDE; { INSIDE: say $i; } # now fatal -
Time::HiRes::sleep • prototype is changed • not released to the
CPAN yet • modules mocking it warn now (Time::MockTime::HiRes, etc) -
Perl Steering Council Since 2026/08 • Paul Evans • Graham
Knopp • Leon Timmermans -
5.45.1: Performance enhancement Some pattern matches against long strings are
now faster use v5.45.1; "-" x 10_000_000 =~ /^abc.*def/ -
5.45.2: Magic v2 • internal structure change • versioned and
typed for extendability • no new abilities so far https://perl.github.io/PPCs/ppc0035-magic-v2/ -
5.45.2: class fields and a leading underscore use v5.44; use
experimental ’class’; class Foo { field $bar :param :reader :writer; # field $bar :param(bar) :reader(bar) :writer(set_bar); } -
5.45.2: class fields and a leading underscore use v5.44; use
experimental ’class’; class Foo { field $_bar :param :reader :writer; # field $_bar :param(_bar) :reader(_bar) :writer(set__bar); } -
5.45.2: class fields and a leading underscore In larger classes,
it is suggested to prefix the field names with a leading underscore to make them more visually distinct. use v5.45.2; use experimental ’class’; class Foo { field $_bar :param :reader :writer; # field $_bar :param(bar) :reader(bar) :writer(set_bar); method baz { $_bar->do_something; } } -
5.45.2: integer and ++/-use v5.45.2; use integer; my $n =
1.7; $n++; say $n; # 2 (previously 2.7) -
5.45.2: Perl AI usage policy You might remember these blog
posts in April 2026 • 575 Pull Requests in Three Weeks: What Happens When AI Meets CPAN Maintenance • AI Contributions to CPAN: The Copyright Question • • https://blogs.perl.org/users/todd_rinaldo/2026/04/575-pull-requests-in-three-weeks-what-happens-when-ai-meets-cpan-maintenance.html https://blogs.perl.org/users/todd_rinaldo/2026/04/ai-contributions-to-cpan-the-copyright-question.html -
5.45.2: Perl AI usage policy A new AI Policy was
introduced • AI agents must not create issues or pull requests, etc. • Do not use an LLM to write code that you could not have written yourself. • LLM-generated prose is grounds for dismissing a contribution • comments in the code must be reviewed to avoid verbosity • exceptions • security analysis verified by a qualified human • translation of human-written messages • The fact that AI was used to generate any part of any contribution must be disclosed. • LLM-assisted examination of the codebase is up to the contributor. https://metacpan.org/release/ETHER/perl-5.45.2/view/AI_POLICY.md -
5.45.3: Undef-aware equality operators PPC0030: Syntax::Operator::Equ (2021-) use Syntax::Operator::Equ; if
( $x equ $y ) { ... } if ( $x === $y ) { ... } -
5.45.3: Undef-aware equality operators Now those operators are implemented in
core use v5.45.3; use experimental 'equ’; if ( $x equ $y ) { ... } if ( $x !== $y ) { ... } -
5.45.3: Undef-aware equality operators Negations of them are also implemented
(unlike Syntax::Operator::Equ) use v5.45.3; use experimental 'equ’; if ( $x neu $y ) { ... } if ( $x !== $y ) { ... } -
5.45.3: Caller optimization "Common" list slices of caller return values
will be more efficient. use v5.45.3; my ($package, $filename, $line) = (caller)[0, 1, 2]; my $sub = (caller)[3]; -
XPerl XPerl is an experimental fork of Perl intended to
be a batteries-included distribution suitable for the AI era. XPerl permits AI-assisted contributions Case/match alternative, based on Elixir’s case structure Classes and roles Structured exceptions Added CPAN distributions: Cpanel::JSON::XS, DBI, DBD::SQLite, IO::Socket::SSL, Net::SSLeay, Perl::Tidy, TOML::Tiny, Text::CSV_XS, YAML::XS • Tensor::XS • • • • • https://github.com/demerphq/xperl -
@cpan.org forwarding is dead • since Apr. 25, 2026 •
update contact info • CPAN modules (POD, META, etc) • PAUSE • blogs.perl.org • git config and .mailmap • GitHub • SNS, etc. • https://blogs.perl.org/users/meta/2026/05/at-cpan-dot-org-on-bpo.html • https://security.metacpan.org/2026/06/14/cpan.org-email-forwarding-shutdown.html -
PAUSE account recovery • • • • • ~75% of
PAUSE accounts are "locked out" now (~70% of Japanese PAUSE accounts) (~75% of dists are maintained by active users) Contact [email protected] if you can’t login with your PAUSE ID and what you are going to do -
PAUSE and VERSION PAUSE started refusing non-standard VERSIONs (2026/10) ◦
package Name 1.5; ◦ our $VERSION = ’1.5’; ◦ our $VERSION = version->declare(’v1.5.0’); ◦ our $VERSION = ’1.5_01’; $VERSION = eval $VERSION; × $VERSION = sprintf "%d.%02d", q$Revision: ... $ =~ /(¥d+)/g; -
Future Perl Events • FOSDEM '27 (Perl & Raku devroom)
(Jan 30-31, 2027, Brussels, Belgium) • German Perl/Raku Workshop 2027 (Apr 14-16, 2027, Hanover, Germany) • Perl Toolchain Summit 2027 (Apr 29-May 2, 2027, Lyon, France) • The Perl and Raku Conference 2027 (Jun 21-23, 2027, Kitchener, Ontario, Canada)