看一下Type::Tiny,我看到对的调用中的类名在Type::Tiny->new官方文档中被引用,
my $NUM = "Type::Tiny"->new(
name => "Number",
constraint => sub { looks_like_number($_) },
message => sub { "$_ ain't a number" },
);
Run Code Online (Sandbox Code Playgroud)
为什么是这样?这仅仅是样式吗?这种做法是否会对性能产生影响?