for $mk (grep {!/^\.+$/} @folders) { #### for $mk @folders) { next if $mk =~ /^\.+$/;