my $dir = 'somewhere'; opendir my $dh, $dir or die $!; while (my $file = readdir $dh) { print "Too big: $file\n" if -s "$dir/$file" > 1024**2 }