Without a reference, you copy the entire array or hash onto the function call stack, and then copy it again in the function.
如果不使用引用,就需要将整个数组或 hash 表复制到该函数的调用栈中,然后在函数中再次对其进行复制。
This is the most flexible way to concatenate strings because you can use it to append just one string, a few strings at a time, or an entire array of strings.
这是连接字符串最灵活的方法,因为你可以用它追加一个字符串,或者一次追加几个字符串,或者一个完整的字符串数组。
The caller needs to wait until the method builds the entire array and returns. That induces a performance penalty when the directory happens to contain lots of files.
调用者需要等到方法构建好数组并返回后才能继续执行下面的代码,而一旦目录中含有大量文件时这么做的效率就很低下了。
应用推荐