my @onlyFiles= grep {{-f "$dir/$_" and /jpe?g$/} readdir(DIR);