for (readdir DIR) { next if $_ eq '.' || $_ eq '..'; push (@files,$_) && next if -f $base/$_; push (@dirs,$_) && next if -d $base/$_; # default to no operation }