in reply to Directory contents

Apply grep to the results of a map that uses a glob
my @files = grep -f, map glob("$_/*"), @ARGV;
HTH

_________
broquaint

Replies are listed 'Best First'.
Re: Re: Directory contents
by qadwjoh (Scribe) on Jan 28, 2004 at 15:54 UTC
    This is the idea I had, but I need to get it to also fill in any subdirectories it finds.

    A
      Then File::Find::Rule should do the trick e.g
      use File::Find::Rule; my @files = find(file => in => \@ARGV);
      HTH

      _________
      broquaint

        This works great thanks.

        Is there any way to get it to only list files that exist and skip those that don't without an error message?

        A