perl-5.38.0
sub NAME BLOCK
sub NAME (PROTO) BLOCK
sub NAME : ATTRS BLOCK
sub NAME (PROTO) : ATTRS BLOCK

This is subroutine definition, not a real function per se. Without a BLOCK it's just a forward declaration. Without a NAME, it's an anonymous function declaration, so does return a value: the CODE ref of the closure just created.

これはサブルーチン定義であり、本質的には 実際の関数ではありません。 BLOCK なしの場合、これは単に前方宣言です。 NAME なしの場合は、無名関数定義であり、値(作成したブロックの コードリファレンス)を返します: 単にクロージャの CODE リファレンスが 作成されます。

See perlsub and perlref for details about subroutines and references; see attributes and Attribute::Handlers for more information about attributes.

サブルーチンとリファレンスに関する詳細については、perlsubperlref を参照してください; 属性に関する更なる情報については attributesAttribute::Handlers を参照してください。