函数如何将其参数列表作为数组引用返回

paw*_*ior 0 perl

我如何编写一个返回其参数作为数组引用的函数?

max*_*ost 12

sub f {
   return [@_];
}

$ref = f(2, 3, 5);
print "@$ref\n";
Run Code Online (Sandbox Code Playgroud)

[@foo]构造创建对新的匿名数组(副本@foo)\@foo的引用,而构造创建对@foo数组的引用,其内容可能稍后更改.