Upgrade to Pro — share decks privately, control downloads, hide ads and more …

2024年秋のPerl

Kenichi Ishigaki
October 05, 2024
280

 2024年秋のPerl

YAPC::Hakodate 2024

Kenichi Ishigaki

October 05, 2024
Tweet

Transcript

  1. 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 <- イマココ
  2. Perl Toolchain Summit 2024 • 今年はリスボンで開催 • 私は引き続きPAUSE中心 • Japan

    Perl Association が スポンサーに (ありがとうございます) https://charsbar.hatenadiary.org/entry/2024/05/27/222017
  3. CVE-2024-45321 • 99% 大丈夫だけど、残り 1% の CI が壊れるんじゃないか • SSL

    in core が実現したら別だけど、いま安全側に倒しすぎて 大丈夫なのか • --insecure フラグを用意したらどうか • …というところで話が止まっている
  4. CVE-2024-45321 • 多くのサイトでは http から https にリダイレクトされる • いくつか例外的なサイトがある •

    backpan.perl.org • cpanmetadb.org • バージョン固定すると危険性が高くなる
  5. CVE-2024-45321 自分でパッチを当ててしまう • PRをチェックアウトして自前でビルドしてもよいですが… • インストール済みの cpanm を書き換えるのが楽 perl -pi

    -E 's{http://(www¥.cpan¥.org|backpan¥.perl¥.org|cpan¥.metacpan¥.org| fastapi¥.metacpan¥.org|cpanmetadb¥.plackperl¥.org)}{https://$1}g' /path/to/cpanm https://security.metacpan.org/2024/08/26/cpanminus-downloads-code-using-insecure-http.html
  6. ツールチェインのサポート下限 先日まではひとつ制限事項がありました https://github.com/Perl-Toolchain-Gang/toolchain-site/blob/master/lyon-amendment.md As a special one-time exception, the minimum

    perl requirement on these distributions will not move past v5.16.0 until July 2024, when Red Hat Enterprise Linux and CentOS v7 leave their maintenance support phase, even though v5.16.0 was released more than 10 years ago today.
  7. ツールチェインのサポート下限 • RHEL/CentOS 7 が退役し、例外事項がなくなりました • 2014年5月リリースの Perl 5.20 を下限にできます

    • 以下の実験的機能がツールチェーンに解禁されました • サブルーチンシグネチャ • ポストフィックスデリファレンス ($HASH->%*, $ARRAY->@*)
  8. ツールチェインのサポート下限 Lyon Amendment の落とし穴: Amazon Linux 2 Q:Amazon Linux 2

    のサポートはいつ終了するのですか? Amazon Linux 2 のサポート終了日 (EOL、End of Life) は、次の バージョンへの移行に十分な時間を提供するために、2023 年 6 月 30 日から 2025 年 6 月 30 日に 2 年間延長されました。 https://aws.amazon.com/jp/amazon-linux-2/faqs/
  9. try/catch (5.34~) finally (5.36~) はまだ実験中です use experimental qw(try); try {

    ... } catch ($e) { ... } finally { ... } 5.38でgotoに関する修正が入っています
  10. builtinモジュール (5.36~) 5.40の時点ではさらに増えています use builtin qw(:5.40); # true false indexed

    # weaken unweaken is_weak # blessed refaddr reftype # ceil floor is_tainted trim
  11. builtinモジュール (5.36~) 一部の関数はまだ実験状態です use experimental qw(builtin); use builtin ( 'is_bool',

    # 5.36~ 'export_lexically', # 5.38~ 'created_as_string', # 5.38~ 'created_as_number', # 5.38~ );
  12. builtin::load_module バージョン指定はできません use experimental qw(builtin); use builtin qw(load_module); use Module::Runtime

    qw(use_module); ◦use_module('Foo::Bar', '1.00')->new; ×load_module('Foo::Bar', '1.00')->new; ◦load_module('Foo::Bar')->VERSION('1.00');
  13. builtin::load_module require との比較 use experimental qw(builtin); use builtin qw(load_module); ◦require

    v5.40; ◦require CGI; ◦require './jcode.pl'; ×load_module(v5.40); ×load_module(CGI); ×load_module('./jcode.pl');
  14. __CLASS__キーワード $selfが使えない場所で使うと便利? use v5.40; use experimental qw(class); class Foo {

    use constant DEFAULT_X => 10; field $x = __CLASS__->DEFAULT_X; method say_x { say $x } } class Bar :isa(Foo) { use constant DEFAULT_X => 20; }
  15. __CLASS__キーワード methodはインスタンスからは呼べないので要注意 use v5.40; use experimental qw(class); class Foo {

    field $x = __CLASS__->default_x; # ERROR! method default_x { 10 } method say_x { say $x } } class Bar :isa(Foo) { method default_x { 20 } }
  16. 新しいフィールド属性 :reader 属性がコアに入りました use v5.40; use experimental qw(class); class Author

    { field $name :param :reader; } my $author = Author->new(name => 'me'); say $author->name;
  17. CORE::chdir (5.41.1) chdirをCORE付きで呼び出せるようになりました use experimental 'class'; class MyClass { method

    chdir { my $path = shift; &CORE::chdir($path) or return; say STDERR "CHDIR TO $path"; } }
  18. source::encoding (5.41.2) __DATA__ や __END__ 以降は OK use v5.41; #

    ASCII ONLY __END__ =pod NAME 取扱説明書 # OK =cut
  19. source::encoding (5.41.2) 指定できるのは ascii と utf8 のみ use source::encoding 'utf8';

    # ≒use utf8; STDOUT->binmode('utf8'); say 'あああ'; # utf8 なら OK
  20. この先の主要Perl関連イベント • London Perl and Raku Workshop (10/24, London, England)

    • German Perl/Raku Workshop 2025 (詳細未定) • Perl Toolchain Summit 2025? (詳細未定) • The Perl and Raku Conference 2025???