#!/usr/bin/perl use warnings; use strict; use CGI::Carp qw(fatalsToBrowser); use CGI qw/:standard/; print header, start_html; my $img_src = "http://www.learntogoogle.com/images/addform.jpg"; print qq(); use Image::Info qw(image_info dim); my $info = image_info($img_src); if (-e $img_src) { print "Image was found."; } else { print "Image is not available"; } if ( my $error = $info->{error} ) { die "Can't parse image info: $error\n"; } my ( $width, $height ) = dim($info);