Perl Imgsize not working in loop?
问题 I've tested getting the image size using perl with the following simple code while sitting in one directory: #!/usr/local/bin/perl use Image::Size; my $x; my $y; my $id; opendir my $dh, "." or die "$0: opendir: $!"; ($x, $y, $id) = imgsize("test_image.png"); print $x." , ".$y."\n"; This worked fine, it gave me the correct width and height of the image. Then I incorporated it into my larger code, where I'm looping through folders and files. So the bigger code is this: # I first get into a