use Image::Size; for (glob '*.jpg') { my ($x, $y) = imgsize($_); print "$_: xsize = $x, ysize = $y\n"; }