my @F = grep { /^\w/ and not -d "$myDir/$_" } readdir( I ); #### use Path::Tiny; my @files = grep !$_->is_dir, path( $myDir )->children( qr/^\w/ );