- 论坛徽章:
- 0
|
4楼
发表于 2011-10-28 00:21
回复 3# zhlong8
多谢3楼的解答。
手头是5.12版本的,确实和我在主楼写的显示一样,然后去翻了下5.12-5.14的升级,终于找到了问题:
Some Perl operators did not distinguish between these two types of globs. This would result in strange behaviour in edge cases: untie $scalar would not untie the scalar if the last thing assigned to it was a glob (because it treated it as untie *$scalar , which unties a handle). Assignment to a glob slot (such as *$glob = \@some_array ) would simply assign \@some_array to $glob .
原文链接:http://perldoc.perl.org/5.14.0/perldelta.html#Selected-Bug-Fixes
标量和其中存储的typeglob的行为区别是一个bug,现在已经修复:
To fix this, the *{} operator (including its *foo and *$foo forms) has been modified to make a new immutable glob if its operand is a glob copy. This allows operators that make a distinction between globs and scalars to be modified to treat only immutable globs as globs. (tie, tied and untie have been left as they are for compatibility's sake, but will warn. See Deprecations.) |
|