+ -
当前位置:首页 → 问答吧 → 关于perldoc文档中reverse函数的疑问

关于perldoc文档中reverse函数的疑问

时间:2010-10-25

来源:互联网

今天,一如既往的使用@a = reverse @a  突然想查查文档,就看了一下http://perldoc.perl.org/functions/reverse.html
发现后面这么说“Note that reversing an array to itself (as in @a = reverse @a ) will preserve non-existent elements whenever possible, i.e., for non magical arrays or tied arrays with EXISTS and DELETE methods.”

问题:
1. @a = reverse @a  我一般都是这样用reverse的。这样用好不好?还有更好的办法吗?
2. 到底什么是non magical arrays?我没找到定义。。。。。。

作者: py   发布时间: 2010-10-25

回复 py


    应该是指 bless 或 tie 过的

作者: zhlong8   发布时间: 2010-10-25