use Image::Size; # get the image size, and print it out my( $width, $height ) = imgsize( $imagefile_pathname );