in reply to
"double free or corruption" in Perl 5.16.0 but not in 5.14.2
I couldn't replicate your problem, tested on 5.8x thru 5.17.4. At first, I thought the problem was with
File::Glob; however, I kept getting an exception with chdir. It seems that there's a portability issue. I don't have fchdir, so I can't pass it a filehandle nor dirhandle without getting
chdir('') has been deprecated...
I stopped after this:
#!perl -l
BEGIN {
$| = 1;
}
use autodie;
use strict 'refs';
use warnings FATAL => 'syntax';
use Data::Dumper::Concise;
use File::Glob ':globally';
use Memoize;
memoize('no_bug', LIST_CACHE => 'MEMORY');
no_bug();
sub no_bug {
my(@md) = (1..305);
my(@mp) = (1000..1205);
print "market detail: ", scalar(@md);
print "market price: ", scalar(@mp);
my $path = '/tmp/xx';
foreach my $md(@md) {
&open(my $f, '<', $path);
&close($f);
}
foreach my $mp(@mp) {
&open(my $f, '<', $path);
&close($f);
}
chdir '/tmp/xx';
my(@sources) = <~$path/mp_*>,
<~$path/md_* >;
print Dumper(scalar @sources);
}