in reply to Stat function returning an empty list

use Path::Tiny it readdirs for you so you don't have to trip The_Last_Monk :) it even takes care of dots directories, and even takes regex to filter names
use Path::Tiny qw/ path /; my @textfiles = path( $dir )->children( qr/\.txt$/i );

Replies are listed 'Best First'.
Re^2: Stat function returning an empty list (path/tiny)
by Anonymous Monk on Mar 06, 2015 at 23:08 UTC

    File::Find has the ability to not visit any subdirectories via preprocess option if follow* options are false. (Else, all the files would have to be iterated over in a directory only to skip them all.) Does Path::Tiny not have that? While browsing the P::T code I had a smidgen of hope as the (directory) search is hand written, but did not find anything relevant.

        What the hell, homework? You missed my point then; I may try again.