for (readdir DIR) { next if $_ eq "." or $_ eq ".."; next unless -d "$base/$_" or -f _; push @{ -d _ ? \@dirs : \@files }, $_; }