我从2000年的聊天板中引用了PerlFaq中的这段智慧.
Is there a leak/bug in glob()?
Due to the current implementation on some operating systems,when you
use the glob() function or its angle-bracket alias in a scalar
context,you may cause a leak and/or unpredictable behavior. It’s best
therefore to use glob() only in list context.
我读到这个问题在Perl 5.6中得到修复,但后来听到一个报告,它仍然出现在5.10.1中
有没有人对最近的问题有任何经验,哪里有最好的地方找到关于此的确定答案?
[稍后..]最新的PerlFAQ说:
5.18: Is there a leak/bug in glob()?
(contributed by brian d foy)
Starting with Perl 5.6.0,“glob” is implemented internally rather than
relying on an external resource. As such,memory issues with “glob”
aren’t a problem in modern perls.
=====
最后:报告的问题是由于在已经给出了所有匹配的项目之后在循环中使用它而滥用了glob.它没有问题.
解决方法
使用Source Luke和Commit History
http://perl5.git.perl.org/perl.git/history/HEAD:/ext/File-Glob