Perl 5.22 和之前的子程序有 * 原型有什么区别?

What is the difference about subroutine has the * prototype between Perl 5.22 and before?

我阅读了有关 Changes to the * prototype

的 Perl 文档

Changes to the * prototype
The * character in a subroutine's prototype used to allow barewords to take precedence over most, but not all, subroutine names. It was never consistent and exhibited buggy behavior.

Now it has been changed, so subroutines always take precedence over barewords, which brings it into conformity with similarly prototyped built-in functions

代码示例:

sub splat(*) { ... }
sub foo { ... }
splat(foo); # now always splat(foo())
splat(bar); # still splat('bar') as before
close(foo); # close(foo())
close(bar); # close('bar')

谁能给我解释一下区别?感谢您的帮助。

perldelta 条目说明的是,当 foo() 是预定义函数时,在 5.22 之前,调用 splat(foo) 可能已被解析器解释为 splat(foo()) 或 splat ('foo'),但您无法轻易分辨出是哪一个。现在它将始终被视为 splat(foo()).