use strict; use PDL; use PDL::IO::Pic; use PDL::IO::GD; $|++; for my $i (0 .. 500) { print "$i\n"; test(); } sub test { my $path = 'largeimage.png'; my $im = PDL::IO::GD->new( {filename => $path} ); undef $im; }