in reply to Re: Use of special character "*" to retrieve the contents
in thread Use of special character "*" to retrieve the contents

It's important to note there is a difference between readdir/glob and File::Find/find: the latter recurses into subdirectories as well. As for running external commands, I wrote about that, including the potential security risks, at length here. At the very least I would recommend using something like IPC::System::Simple's capturex, e.g. my @files = capturex("find",$path,qw/ ( -name *.ksh -o -name *.txt ) /);

Replies are listed 'Best First'.
Re^3: Use of special character "*" to retrieve the contents
by karlgoethebier (Abbot) on Jun 07, 2017 at 16:54 UTC
    "... the latter recurses..."

    But fortunately there is -maxdepth 0. From find:

    -maxdepth n Always true; descend at most n directory levels below the + command line arguments. If any -maxdepth primary is specified, it applies to the entire +expression even if it would not normally be evaluated. ``-maxdepth 0'' limits the whole +search to the command line argu- ments.

    Best regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    Furthermore I consider that Donald Trump must be impeached as soon as possible