use Image::Size;
merlyn's old article has the details.
In reply to Re: dereferencing problem by thpfft in thread dereferencing problem by NereDoWell