# 'use's and stuff go here my ($scale, $unit) = ($ARGV[0] =~ /^\d+$/) ? (shift,"in") : (1,"px"); for (map {glob} @ARGV) { my ($x,$y,$id) = imgsize($_); print "$_ width=",$x/$scale,"$unit, height=",$y/$scale,"$unit\n"; }