my $imginfo = qx[ file $myimg ]; my (width, height)= ($imginfo =~ m{(\d+) x (\d+) x \d+});